Graphex.Dag

Summary

add_edges(dag, name, deps)

Add edges to a dag

add_vertex(dag, opts)

Add a vertex to a dag

add_vertex(dag, name, deps, fun, tries)

Add a vertex to a dag

add_vertex_and_edges(dag, opts)

This will add a vertex and edges for all it’s dependencies

delete(dag)

Delete the dag

downstreams(dag, v)

Get a list of verticies that are downstream of a given vertex. That is, get the list of verticies that depend on the result of the given vertex

in_neighbors(dag, vertex)

Get a list of all verticies that are “in neighbors”

in_vertex(dag, e)

Get the in-vertex for a given edge

in_verticies(dag, edges)

Get the list of in-verticies for the given list of edges

new()

Create a new directed acyclic graph

out_edges(dag, vertex)

Get a list of out edges for the given dag and vertex

out_neighbors(dag, vertex)

Get a list of all verticies that are “out neighbors”

out_vertex(dag, e)

Get the out vertex for a given edge

out_verticies(dag, edges)

Get a list of out verticies for a given list of edges

start_verticies(dag)

Get the list of verticies that have no dependencies

upstreams(dag, v)

Get the list of verticies that are upstream of the given vertex. That is, get the list of verticies that the given vertex depends on the result of

vertex(dag, vertex)

Get the vertex and label

vertices(dag)

Get a list of verticies

Types

dag :: :digraph.graph

Directed Acyclic Graph

deps :: [Graphex.vertex] | nil

Vertex dependencies

Functions

add_edges(dag, name, deps)

Specs:

Add edges to a dag

add_vertex(dag, opts)

Specs:

Add a vertex to a dag

add_vertex(dag, name, deps, fun, tries)

Specs:

Add a vertex to a dag

add_vertex_and_edges(dag, opts)

Specs:

This will add a vertex and edges for all it’s dependencies.

If the dependency has not yet been added to the graph, this function will silently not add it.

It is safer to use Graphex.graph(components) as that function will return {:error, message} if dependencies are missing. It doesn’t care about the order the components are specified in.

delete(dag)

Specs:

  • delete(dag) :: boolean

Delete the dag

downstreams(dag, v)

Specs:

Get a list of verticies that are downstream of a given vertex. That is, get the list of verticies that depend on the result of the given vertex.

in_neighbors(dag, vertex)

Specs:

Get a list of all verticies that are “in neighbors”

in_vertex(dag, e)

Specs:

Get the in-vertex for a given edge

in_verticies(dag, edges)

Specs:

Get the list of in-verticies for the given list of edges

new()

Specs:

Create a new directed acyclic graph

out_edges(dag, vertex)

Specs:

Get a list of out edges for the given dag and vertex

out_neighbors(dag, vertex)

Specs:

Get a list of all verticies that are “out neighbors”

out_vertex(dag, e)

Specs:

Get the out vertex for a given edge

out_verticies(dag, edges)

Specs:

Get a list of out verticies for a given list of edges

start_verticies(dag)

Specs:

Get the list of verticies that have no dependencies

upstreams(dag, v)

Specs:

Get the list of verticies that are upstream of the given vertex. That is, get the list of verticies that the given vertex depends on the result of.

vertex(dag, vertex)

Specs:

Get the vertex and label

vertices(dag)

Specs:

Get a list of verticies