question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: directed acyclic graph implementation in common.graph

See original GitHub issue

As 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:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:38 (22 by maintainers)

github_iconTop GitHub Comments

2reactions
Bezier89commented, Oct 25, 2016

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.

1reaction
jbduncancommented, Oct 8, 2017

That sounds fair enough to me. Thanks for taking the time to contribute to the earlier discussion @jrtom!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found