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.
sourceraw docstring

append-pathclj

(append-path g path)

Appends a path onto a graph.

Appends a path onto a graph.
sourceraw docstring

bidirectionalclj

(bidirectional g)

Returns a new graph where all edges go both directions.

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

branchesclj

(branches g)

Returns the branches of the tree.

Returns the branches of the tree.
sourceraw docstring

bridge?clj

(bridge? g edge)

Is the given edge a bridge of the graph g?

Is the given edge a bridge of the graph g?
sourceraw docstring

bridgesclj

(bridges g)

Returns the edges whose removal would alter the transitive closure of the graph (increase the number of connected components).

Returns the edges whose removal would alter the transitive closure
of the graph (increase the number of connected components).
sourceraw docstring

complementclj

(complement g)

Returns the difference between fully connected g and g

Returns the difference between fully connected g and g
sourceraw docstring

completeclj

(complete g)

Returns the fully connected variant of g

Returns the fully connected variant of g
sourceraw docstring

complete?clj

(complete? g)

Is the graph complete?

Is the graph complete?
sourceraw 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?
sourceraw docstring

consumersclj

(consumers g)

Get all nodes with inbound edges.

Get all nodes with inbound edges.
sourceraw 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).
sourceraw docstring

cyclical?clj

(cyclical? g)

Are there cycles in this graph?

Are there cycles in this graph?
sourceraw 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.
sourceraw docstring

degreeclj

(degree g n)

How many edges does this node have?

How many edges does this node have?
sourceraw docstring

differenceclj

(difference g1 g2)

Subtract g2 from g1.

Subtract g2 from g1.
sourceraw docstring

edgesclj

(edges g)

Get the set of edges of graph g.

Get the set of edges of graph g.
sourceraw 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.
sourceraw docstring

exclusive?clj

(exclusive? g1 g2)

Returns whether the graphs don't overlap.

Returns whether the graphs don't overlap.
sourceraw 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.
sourceraw docstring

exteriorclj

(exterior g)

Returns the exterior nodes of the graph.

Returns the exterior nodes of the graph.
sourceraw 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.
sourceraw docstring

graphclj

(graph edges)
(graph nodes edges)

Create a graph from a set of edges

Create a graph from a set of edges
sourceraw docstring

incoming-degreeclj

(incoming-degree g n)

Gets the incoming degree of n.

Gets the incoming degree of n.
sourceraw 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.
sourceraw 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.
sourceraw docstring

interiorclj

(interior g)

Returns the interior nodes of the graph.

Returns the interior nodes of the graph.
sourceraw docstring

intersect?clj

(intersect? g1 g2)

Returns whether the graphs overlap.

Returns whether the graphs overlap.
sourceraw docstring

intersectionclj

(intersection g1 g2)

Intersect two graphs.

Intersect two graphs.
sourceraw docstring

inverseclj

(inverse g)

Invert the graph by reversing all edges.

Invert the graph by reversing all edges.
sourceraw docstring

leavesclj

(leaves g)

Returns the leaves of the tree.

Returns the leaves of the tree.
sourceraw docstring

mapgclj

(mapg f g)

Transform nodes in the graph according to f.

Transform nodes in the graph according to f.
sourceraw docstring

neighborsclj

(neighbors g n)

Gets all the neighbors of n.

Gets all the neighbors of n.
sourceraw docstring

nodesclj

(nodes g)

Get all nodes from the graph g.

Get all nodes from the graph g.
sourceraw 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.
sourceraw docstring

outgoing-degreeclj

(outgoing-degree g n)

Gets the outgoing degree of n.

Gets the outgoing degree of n.
sourceraw 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.
sourceraw 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.
sourceraw docstring

producersclj

(producers g)

Get all nodes with outbound edges.

Get all nodes with outbound edges.
sourceraw docstring

remove-edgeclj

(remove-edge g [from to])

Removes an edge from a graph.

Removes an edge from a graph.
sourceraw docstring

remove-pathclj

(remove-path g path)

Removes a path from a graph.

Removes a path from a graph.
sourceraw 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.
sourceraw docstring

rootclj

(root g)

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

Returns the root of the graph if any, else nil.
sourceraw 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'
sourceraw docstring

self-loopedclj

(self-looped g)

Returns a new graph where self-loops were added to all nodes in g.

Returns a new graph where self-loops were added to all nodes in g.
sourceraw docstring

self-loopsclj

(self-loops g)

Returns the nodes that have self-loops.

Returns the nodes that have self-loops.
sourceraw 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.
sourceraw docstring

sink?clj

(sink? g n)

Is n a node with no outgoing edges?

Is n a node with no outgoing edges?
sourceraw docstring

sinksclj

(sinks g)

Get all nodes with no outbound edges.

Get all nodes with no outbound edges.
sourceraw docstring

source?clj

(source? g n)

Is n a node with no incoming edges?

Is n a node with no incoming edges?
sourceraw docstring

sourcesclj

(sources g)

Get all nodes with no inbound edges.

Get all nodes with no inbound edges.
sourceraw docstring

subgraph?clj

(subgraph? g1 g2)

Is g1 a subgraph of g2?

Is g1 a subgraph of g2?
sourceraw docstring

supergraph?clj

(supergraph? g1 g2)

Is g1 a supergraph of g2?

Is g1 a supergraph of g2?
sourceraw 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.
sourceraw docstring

topological-sortclj

(topological-sort g)

Returns a topological sort of the adjacency map

Returns a topological sort of the adjacency map
sourceraw 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.
sourceraw 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.
sourceraw docstring

transitive-differenceclj

(transitive-difference g1 g2)

Returns the subgraph of g1 that isn't transitively referenced by g2.

Returns the subgraph of g1 that isn't transitively referenced by g2.
sourceraw docstring

transitive-intersectionclj

(transitive-intersection g1 g2)

The intersection of g1 and g2, extended by anything transitively reachable in either graph.

The intersection of g1 and g2, extended by anything transitively reachable in either graph.
sourceraw docstring

transitive-symmetric-differenceclj

(transitive-symmetric-difference g1 g2)

Returns the union of those subgraphs which appear in either g1 or g2 but do not appear in their transitive intersection.

Returns the union of those subgraphs which appear in either g1 or g2 but do not appear in their
transitive intersection.
sourceraw docstring

transitive-unionclj

(transitive-union g1 g2)

Returns g1 extended by the transitive intersection of g1 and g2.

Returns g1 extended by the transitive intersection of g1 and g2.
sourceraw docstring

tree?clj

(tree? g)

Is this graph a tree?

Is this graph a tree?
sourceraw docstring

unionclj

(union g1 g2)

Union two graphs together.

Union two graphs together.
sourceraw 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.
sourceraw docstring

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

× close