Liking cljdoc? Tell your friends :D

missing.topology

Simple graph functions for graphs in adjacency map form.

Simple graph functions for graphs in adjacency map form.
raw docstring

append-edgeclj

(append-edge g [from to])

Appends an edge to a graph.

Appends an edge to a graph.
raw docstring

append-pathclj

(append-path g path)

Appends a path onto a graph.

Appends a path onto a graph.
raw docstring

bidirectionalclj

(bidirectional g)

Returns a new graph where all edges go both directions.

Returns a new graph where all edges go both directions.
raw docstring

branchesclj

(branches g)

Returns the branches of the tree.

Returns the branches of the tree.
raw docstring

complementclj

(complement g)

Returns the difference between fully connected g and g

Returns the difference between fully connected g and g
raw docstring

completeclj

(complete g)

Returns the fully connected variant of g

Returns the fully connected variant of g
raw docstring

complete?clj

(complete? g)

Is the graph complete?

Is the graph complete?
raw docstring

connected?clj

(connected? g)

Can you navigate from any starting node to any other node?

Can you navigate from any starting node to any other node?
raw docstring

consumersclj

(consumers g)

Get all nodes with inbound edges.

Get all nodes with inbound edges.
raw docstring

contractgclj

(contractg pred g)

Removes nodes that match pred and adds new edges between inbound and outbound neighbors of each node impacted (leaves the transitive closure otherwise intact).

Removes nodes that match pred and adds new edges between
inbound and outbound neighbors of each node impacted
(leaves the transitive closure otherwise intact).
raw docstring

cyclical?clj

(cyclical? g)

Are there cycles in this graph?

Are there cycles in this graph?
raw docstring

defgncljmacro

(defgn symbol docs bindings & body)

Like defn but handles normalizing any 'g or g{digit}' arguments first.

Like defn but handles normalizing any 'g or g{digit}' arguments first.
raw docstring

degreeclj

(degree g n)

How many edges does this node have?

How many edges does this node have?
raw docstring

differenceclj

(difference g1 g2)

Subtract g2 from g1.

Subtract g2 from g1.
raw docstring

edgesclj

(edges g)

Get the set of edges of graph g.

Get the set of edges of graph g.
raw docstring

emptyclj

(empty g)

Returns a graph with the same nodes as g but no edges.

Returns a graph with the same nodes as g but no edges.
raw docstring

exclusive?clj

(exclusive? g1 g2)

Returns whether the graphs don't overlap.

Returns whether the graphs don't overlap.
raw docstring

expandgclj

(expandg f g)

Expand nodes into more nodes while maintaining all the same edges between any new nodes.

Expand nodes into more nodes while maintaining all the same edges
between any new nodes.
raw docstring

exteriorclj

(exterior g)

Returns the exterior nodes of the graph.

Returns the exterior nodes of the graph.
raw docstring

filtergclj

(filterg pred g)

Only keep nodes in the graph that satisfy pred. All inbound and outbound edges involving removed nodes are also removed.

Only keep nodes in the graph that satisfy pred. All
inbound and outbound edges involving removed nodes are
also removed.
raw docstring

graphclj

(graph edges)
(graph nodes edges)

Create a graph from a set of edges

Create a graph from a set of edges
raw docstring

incoming-degreeclj

(incoming-degree g n)

Gets the incoming degree of n.

Gets the incoming degree of n.
raw docstring

incoming-edgesclj

(incoming-edges g n)

Get all edges that go from another node to n.

Get all edges that go from another node to n.
raw docstring

incoming-neighborsclj

(incoming-neighbors g n)

Gets the neighbors of n from any inbound edges.

Gets the neighbors of n from any inbound edges.
raw docstring

interiorclj

(interior g)

Returns the interior nodes of the graph.

Returns the interior nodes of the graph.
raw docstring

intersect?clj

(intersect? g1 g2)

Returns whether the graphs overlap.

Returns whether the graphs overlap.
raw docstring

intersectionclj

(intersection g1 g2)

Intersect two graphs.

Intersect two graphs.
raw docstring

inverseclj

(inverse g)

Invert the graph by reversing all edges.

Invert the graph by reversing all edges.
raw docstring

leavesclj

(leaves g)

Returns the leaves of the tree.

Returns the leaves of the tree.
raw docstring

mapgclj

(mapg f g)

Transform nodes in the graph according to f.

Transform nodes in the graph according to f.
raw docstring

neighborsclj

(neighbors g n)

Gets all the neighbors of n.

Gets all the neighbors of n.
raw docstring

nodesclj

(nodes g)

Get all nodes from the graph g.

Get all nodes from the graph g.
raw docstring

normalizeclj

(normalize g)

Given an adjacency with potentially missing entries, populate the entries based on the appearance of other nodes on the right side of an edge. Tags the result with metadata so it doesn't recompute for repeat invocations.

Given an adjacency with potentially missing entries, populate
the entries based on the appearance of other nodes on the right
side of an edge. Tags the result with metadata so it doesn't
recompute for repeat invocations.
raw docstring

outgoing-degreeclj

(outgoing-degree g n)

Gets the outgoing degree of n.

Gets the outgoing degree of n.
raw docstring

outgoing-edgesclj

(outgoing-edges g n)

Get all edges that go from n to another node.

Get all edges that go from n to another node.
raw docstring

outgoing-neighborsclj

(outgoing-neighbors g n)

Gets the neighbors of n from any outbound edges.

Gets the neighbors of n from any outbound edges.
raw docstring

producersclj

(producers g)

Get all nodes with outbound edges.

Get all nodes with outbound edges.
raw docstring

remove-edgeclj

(remove-edge g [from to])

Removes an edge from a graph.

Removes an edge from a graph.
raw docstring

remove-pathclj

(remove-path g path)

Removes a path from a graph.

Removes a path from a graph.
raw docstring

removegclj

(removeg pred g)

Remove nodes in the graph that satisfy pred. All inbound and outbound edges involving removed nodes are also removed.

Remove nodes in the graph that satisfy pred. All
inbound and outbound edges involving removed nodes
are also removed.
raw docstring

rootclj

(root g)

Returns the root of the graph if any, else nil.

Returns the root of the graph if any, else nil.
raw docstring

selectclj

(select g from)

Return the subgraph of g that is within reach of 'from'

Return the subgraph of g that is within reach of 'from'
raw docstring

shortest-pathsclj

(shortest-paths g & [weight-fn])

Uses Floyd-Warshall to returns a map of {[source destination] {:distance <num> :path [source ... destination]}} for the given graph. Uses weight-fn (a function of two nodes) to assign a cost to edges.

Uses Floyd-Warshall to returns a map of
{[source destination] {:distance <num> :path [source ... destination]}}
for the given graph. Uses weight-fn (a function of two nodes) to assign a
cost to edges.
raw docstring

sink?clj

(sink? g n)

Is n a node with no outgoing edges?

Is n a node with no outgoing edges?
raw docstring

sinksclj

(sinks g)

Get all nodes with no outbound edges.

Get all nodes with no outbound edges.
raw docstring

source?clj

(source? g n)

Is n a node with no incoming edges?

Is n a node with no incoming edges?
raw docstring

sourcesclj

(sources g)

Get all nodes with no inbound edges.

Get all nodes with no inbound edges.
raw docstring

subgraph?clj

(subgraph? g1 g2)

Is g1 a subgraph of g2?

Is g1 a subgraph of g2?
raw docstring

supergraph?clj

(supergraph? g1 g2)

Is g1 a supergraph of g2?

Is g1 a supergraph of g2?
raw docstring

symmetric-differenceclj

(symmetric-difference g1 g2)

Returns the union of the exclusive sections of g1 and g2.

Returns the union of the exclusive sections of g1 and g2.
raw docstring

topological-sortclj

(topological-sort g)

Returns a topological sort of the adjacency map

Returns a topological sort of the adjacency map
raw docstring

topological-sort-with-groupingclj

(topological-sort-with-grouping g)

Returns a topological sort of the adjacency map and partition items into sets where order is arbitrary.

Returns a topological sort of the adjacency map and
partition items into sets where order is arbitrary.
raw docstring

transitive-closureclj

(transitive-closure g)

Creates new edges on g such that every node connects directly to any node that could previously have been connected indirectly.

Creates new edges on g such that every node connects directly to any
node that could previously have been connected indirectly.
raw docstring

tree?clj

(tree? g)

Is this graph a tree?

Is this graph a tree?
raw docstring

unionclj

(union g1 g2)

Union two graphs together.

Union two graphs together.
raw docstring

walk?clj

(walk? g [x1 x2 & xs])

Check if the given walk is valid for the graph.

Check if the given walk is valid for the graph.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close