Comments (3)
This sounds very useful and would be a welcome addition!
from daggy.
I started implementing it and quickly noticed that it's harder than I thought. All impls of the Walker
trait require a starting node, but I about iterating over every root node, so I'm not quiet sure if I can use the Walker trait at all. I guess I have to create a new one, that doesn't need a NodeId to start with?
Or would you be fine by using the Iterator
trait, but that means borrowing of the Dag
.
from daggy.
@hellow554 if there doesn't seem to be a nice solution with the Walker
trait I would be content with an Iterator
that borrowed the Dag
. It would still be very useful even if a user just wanted to collect each of the roots/leaves into a collection before then iterating over them in a way that doesn't borrow the Dag
.
If you do have an approach in mind that allows for iterating over roots/leaves without borrowing the Dag
but is not suited to a Walker
impl, perhaps this could simply be done with an inherent impl? I don't think we need to introduce another trait if this new type is the only one likely to implement it.
Thanks for taking a stab at this btw!
from daggy.
Related Issues (17)
- Add `.add_edge_unchecked` method, for adding an edge without checking for cycles. HOT 1
- Use heuristic for quick accept without cycle check in `add_edge` HOT 2
- add documentation link to crates.io crate
- Update petgraph and use StableGraph HOT 7
- Iterator over tree ends HOT 2
- Transactional adds/removes
- Petgraph Compile Error HOT 4
- Change `parents` and `children` naming conventions to match petgraph's `incoming` and `outgoing`?
- Links in doc don't work on docs.rs
- using `#![cfg(feature = "stable_dag")]` in lib.rs breaks lib export
- Visualization? HOT 1
- Daggy not detecting loop cycles
- Repository does not contain release tags HOT 1
- Clearing the dag does not clear the cycle state HOT 1
- Release new version HOT 4
- Is there a method for updating the weight of a node?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from daggy.