Comments (3)
Thanks for the report.
I'm wondering if tsort
is the right function to use here? Since you already know the root, would a simple bfs
give you what do want?
That being said, it still might be a good idea to add another argument for specifying a starting dfs
node. It's currently possible in a roundabout way using the #:order
argument, but a cleaner solution would be better. (I won't be able to get to it right away, but I'll leave this issue open in the meantime.)
from graph.
Yeah, I have a DAG representing a partial ordering, and need to be able to flatten it into a list consistent with that partial ordering, but only from the subgraph rooted at a particular node. Obviously one solution would just be to do a full tsort
and trim the list to that node, but I'm going to be doing this a lot, and would prefer not to have the extraneous sibling nodes possibly taking up space in the list. I thought about trying to do some hacks with #:order
, but suspect that would be quite inefficient.
from graph.
As a concrete example, let's say I have the following relationships.
B -> A
C -> A
D -> A
E -> B
E -> C
F -> D
F -> E
If I want to list the nodes in subgraph rooted at E
, sorted consistently with their partial order, then one strategy would be to list out the whole graph, F D E B C A
, and then trim it to just E B C A
, but since F E B C D A
is also a valid topological sort, I could potentially end up with E B C D A
, in which D
is extraneous.
from graph.
Related Issues (20)
- Racket 5 tests don't work HOT 3
- stop supporting Racket versions < 6 HOT 1
- Tests fail on Racket 7 HOT 1
- Please add the racket topic to this repo HOT 1
- Allow setting of graphviz attributes other than color HOT 1
- Implement multigraphs HOT 1
- Serialization HOT 3
- Bug in maximum bipartite matching? HOT 12
- document gen:queue and queue-lib
- edge-weight should allow default value
- invalid version number
- Functional interface? HOT 3
- graphviz: support arbitrary edge values HOT 3
- `undirected-graph` raises `apply` error HOT 4
- support for multigraphs HOT 5
- Typed Racket interface HOT 7
- racket 8 breaks tests
- Is it possible to use Graph Properties to generate better `.dot` files? HOT 7
- Add `directed-graph?` and `undirected-graph?` HOT 8
- Inbound and outbound neighbors for directed graphs
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 graph.