Feature request: directed acyclic graph implementation in common.graph
See original GitHub issueAs it turns out, since I originally posted #2411, the needs for my university project evolved a bit, as I realised I really needed a directed acyclic graph (DAG) rather than a tree.
I believe JGraphT provides an implementation of a DAG, but despite that I decided to settle on Guava 20-rc1 and common.graph
recently (on one hand because I had licensing worries with JGraphT, and on the other hand because I think common.graph
is currently a much cleaner alternative to both JGrapht and JUNG), so I would be excited to see DAG support in say (Graph|ValueGraph|Network)Builder
, in a method like supportsCycles(boolean)
, so I don’t have to implement cycle-checking support myself anymore.
What does the Guava team think of this request?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:5
- Comments:38 (22 by maintainers)
Top Results From Across the Web
Directed Acyclic Graph - GitLab Docs
A directed acyclic graph can be used in the context of a CI/CD pipeline to build relationships between jobs such that execution is...
Read more >Directed Acyclic graph in Compiler Design (with examples)
The Directed Acyclic Graph (DAG) facilitates the transformation of basic blocks. DAG is an efficient method for identifying common sub- ...
Read more >Directed Acyclic Graph (DAG) Overview & Use Cases
A directed acyclic graph (DAG) is a conceptual representation of activities depicted by a graph, which is visually presented as a set of...
Read more >9. Trees and directed acyclic graphs
In this chapter we'll look at trees and directed acyclic graphs (DAGs), ... all the nodes are still expressions and will share many...
Read more >Use of directed acyclic graphs (DAGs) to identify confounders ...
AbstractBackground. Directed acyclic graphs (DAGs) are an increasingly popular approach for identifying confounding variables that require ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Glad to hear you like common.graph!
This is one thing we considered as an option on the *Builders, but is not in the current release because it requires either A) additional memory overhead (e.g. a UnionFind type data structure kept in sync with the graph) or B) a much slower addEdge() method (checking for a cycle on each add).
There is Graphs.hasCycle(), which if you called after every mutation is closer to the second solution.
That sounds fair enough to me. Thanks for taking the time to contribute to the earlier discussion @jrtom!