directed-acyclic-graphs

How do I check if a directed graph is acyclic?

How do I check if a directed graph is acyclic? And how is the algorithm called? I would appreciate a reference. Niko ...

How to convert Directed Acyclic Graph (DAG) to Tree

Hi there, I have been looking for C# examples to transform a DAG into a Tree. Does anyone have an examples or pointers in the right direction? Clarification Update I have a graph that contains a list of modules that my application is required to load. Each module has a list of modules it depends on. For example here are my modules, ...

How can one implement a Compact Directed Acyclic Word Graph (CDAWG) in C?

How would one implement this data structure in C. It is a structure similar to the DAWG, that is more efficient than the trie which only compresses prefixes. The CDAWG is a data structure twice as space efficient as the DAWG. ...

Add a edge to direct acyclic graph with other restrictions

I have a DAG. I have this operation to add a edge between two nodes. If A is reachable from B, then B is A's parent. If A is reachable from B without going though another node, then B is A's direct parent. Requirements for this graph are: No cycles. For any node, there is a list of direct parents P[1],P[2],P[3]... P[i] is not a paren...

Can someone explain in simple terms to me what a Directed acyclic graph is?

Can someone explain in simple terms to me what a Directed acyclic graph is? I have looked on Wikipedia but it doesn't really make me see its use in programming. ...

Finding the Reachability Count for all vertices of a DAG

I am trying to find a fast algorithm with modest space requirements to solve the following problem. For each vertex of a DAG find the sum of its in-degree and out-degree in the DAG's transitive closure. Given this DAG: I expect the following result: Vertex # Reacability Count Reachable Vertices in closure 7 5 ...

Representing dependencies file syntax

I'm looking for a simple way to represent simple dependencies in a file. Preferably I'd like to use some format with a syntax already defined (e.g. JSON, YAML, etc). I'm leaning towards graphviz's dot syntax digraph { A -> B; A -> C; B -> D; } Are there any other ways to do this? This will be for user's to write simple d...

Finding the width of a directed acyclic graph... with only the ability to find parents

Hi guys, I'm trying to find the width of a directed acyclic graph... as represented by an arbitrarily ordered list of nodes, without even an adjacency list. The graph/list is for a parallel GNU Make-like workflow manager that uses files as its criteria for execution order. Each node has a list of source files and target files. We have ...

How is this algorithm, for finding maximum path on a Directed Acyclical Graph, called?

Since some time, I'm using an algorithm that runs in complexity O(V + E) for finding maximum path on a Directed Acyclical Graph from point A to point B, that consists on doing a flood fill to find what nodes are accessible from note A, and how many "parents" (edges that come from other nodes) each node has. Then, I do a BFS but only "act...

list of all paths from source to sink in directed acyclic graph

Can anyone point me to some resources on how to do this? I'm using networkx as my python library. Thanks! ...

How to assign "levels" to vertices of an acyclic directed graph?

I have an acyclic directed graph. I would like to assign levels to each vertex in a manner that guarantees that if the edge (v1,v2) is in the graph, then level(v1) > level(v2). I would also like it if level(v1) = level(v3) whenever (v1,v2) and (v3,v2) are in the graph. Also, the possible levels are discrete (might as well take them to...

Sampling random nodes from a DAG

I have a large directed, acylic graph (DAG) from which I would like to efficiently draw a sample node according to the following criteria: I specify a fixed node A that must never be sampled Nodes that directly or indirectly refer to A are never sampled All other nodes are sampled with equal probability Nodes are stored as objects wi...

Representing a DAG (directed acyclic graph)

I need to store dependencies in a DAG. (We're mapping a new school curriculum at a very fine grained level) We're using rails 3 Considerations Wider than it is deep Very large I estimate 5-10 links per node. As the system grows this will increase. Many reads, few writes most common are lookups: dependencies of first and secon...

All possible paths from one node to another in a directed tree (igraph)

I use python binding to igraph to represent a directed tree. I would like to find all possible paths from one node in that graph to another one. Unfortunately, I couldn't find a ready to use function in igraph that performs this task? EDIT The concerns on infinite number of paths the graph I'm talking about is actually a directed ac...

How to visualize a directed graph with ordered edges?

I want something I can easily imagine. It's hard to reason with crossed arrows and edges colored by order. I don't want the nodes replicated, however. That's more load on the brain. ...