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
Specs:
- add_edges(dag, Graphex.vertex, deps) :: :ok
Add edges to a dag
Specs:
- add_vertex(dag, Graphex.component) :: dag
Add a vertex to a dag
Specs:
- add_vertex(dag, Graphex.vertex, deps, (%{} -> any), integer) :: dag
Add a vertex to a dag
Specs:
- add_vertex_and_edges(dag, Graphex.component) :: dag
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.
Specs:
- delete(dag) :: boolean
Delete the dag
Specs:
- downstreams(dag, Graphex.vertex) :: [Graphex.vertex]
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.
Specs:
- in_neighbors(dag, Graphex.vertex) :: [Graphex.vertex]
Get a list of all verticies that are “in neighbors”
Specs:
- in_vertex(dag, Graphex.edge) :: Graphex.vertex
Get the in-vertex for a given edge
Specs:
- in_verticies(dag, [Graphex.edge]) :: [Graphex.vertex]
Get the list of in-verticies for the given list of edges
Specs:
- new :: dag
Create a new directed acyclic graph
Specs:
- out_edges(dag, Graphex.vertex) :: [Graphex.edge]
Get a list of out edges for the given dag and vertex
Specs:
- out_neighbors(dag, Graphex.vertex) :: [Graphex.vertex]
Get a list of all verticies that are “out neighbors”
Specs:
- out_vertex(dag, Graphex.edge) :: Graphex.vertex
Get the out vertex for a given edge
Specs:
- out_verticies(dag, [Graphex.edge]) :: [Graphex.vertex]
Get a list of out verticies for a given list of edges
Specs:
- start_verticies(dag) :: [Graphex.vertex]
Get the list of verticies that have no dependencies
Specs:
- upstreams(dag, Graphex.vertex) :: [Graphex.vertex]
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.
Specs:
- vertex(dag, Graphex.vertex) :: {Graphex.vertex, %{}}
Get the vertex and label
Specs:
- vertices(dag) :: [Graphex.vertex]
Get a list of verticies