Liking cljdoc? Tell your friends :D

bifurcan-clj.graph

Functions for working with graphs.

Functions for working with graphs.
raw docstring

add-edgeclj

(add-edge g edge)

Adds an edge to the graph.

Adds an edge to the graph.
sourceraw docstring

add-vertexclj

(add-vertex g x)

Adds a vertex to the graph.

Adds a vertex to the graph.
sourceraw docstring

articulation-pointsclj

(articulation-points g)

Returns a set of vertices where the removal of that vertex will partition the graph.

Returns a set of vertices where the removal of that vertex will partition
the graph.
sourceraw docstring

bfs-verticesclj

(bfs-vertices v adjacent)

Performs a breadth-first traversal through a graph implicitly defined by a function (adjacent v) -> [v1, v2, ...] (or any Iterable of vertices). Starts with a single vertex v, and returns an Iterable of vertices.

Performs a breadth-first traversal through a graph implicitly defined by a
function (adjacent v) -> [v1, v2, ...] (or any Iterable of vertices). Starts
with a single vertex v, and returns an Iterable of vertices.
sourceraw docstring

bfs-vertices-from-anyclj

(bfs-vertices-from-any vs adjacent)

Like bfs-vertices, but takes an Iterable of starting vertices.

Like bfs-vertices, but takes an Iterable of starting vertices.
sourceraw docstring

biconnected-componentsclj

(biconnected-components g)

Returns a set of sets of vertices where each vertex can reach every other vertex within the set, even if a single vertex is removed.

Returns a set of sets of vertices where each vertex can reach every other
vertex within the set, even if a single vertex is removed.
sourceraw docstring

bottomclj

(bottom g)

Unclear what this does. Might be broken?

Unclear what this does. Might be broken?
sourceraw docstring

connected-componentsclj

(connected-components g)

Returns a set of sets of vertices where each vertex can reach every other vertex within the set.

Returns a set of sets of vertices where each vertex can reach every other
vertex within the set.
sourceraw docstring

cyclesclj

(cycles g)

Returns a list of lists of all cyclical paths through the graph.

Returns a list of lists of all cyclical paths through the graph.
sourceraw docstring

digraphclj

(digraph)
(digraph hash-fn equals-fn)

Constructs a new directed graph, optionally with custom hash and equality semantics (hash vertex) and (equals? vertex1 vertex2).

Constructs a new directed graph, optionally with custom hash and equality
semantics (hash vertex) and (equals? vertex1 vertex2).
sourceraw docstring

directed-acyclic-graphclj

(directed-acyclic-graph)
(directed-acyclic-graph hash-fn equals-fn)

Constructs a new directed acyclic graph, optionally with custom hash and equality semantics (hash vertex) and (equals? vertex1 vertex2).

Constructs a new directed acyclic graph, optionally with custom hash and
equality semantics (hash vertex) and (equals? vertex1 vertex2).
sourceraw docstring

directed-edgeclj

(directed-edge from to)
(directed-edge from to value)

Constructs a new directed edge with an optional value.

Constructs a new directed edge with an optional value.
sourceraw docstring

directed?clj

(directed? g)

Is this graph directed?

Is this graph directed?
sourceraw docstring

edgeclj

(edge g from to)

The edge value between from and to. Throws if edge doesn't exist.

The edge value between `from` and `to`. Throws if edge doesn't exist.
sourceraw docstring

edge-directed?clj

(edge-directed? edge)

Is an edge from a directed graph?

Is an edge from a directed graph?
sourceraw docstring

edge-fromclj

(edge-from edge)

The source vertex of an edge

The source vertex of an edge
sourceraw docstring

edge-toclj

(edge-to edge)

The destination vertex of an edge.

The destination vertex of an edge.
sourceraw docstring

edge-valueclj

(edge-value edge)

The value associated with an edge.

The value associated with an edge.
sourceraw docstring

edgesclj

(edges g)

An interable over every edge in the graph.

An interable over every edge in the graph.
sourceraw docstring

graphclj

(graph)
(graph hash-fn equals-fn)

Constructs a new Graph, optionally with custom hash and equality semantics (hash vertex) and (equals? vertex1 vertex2).

Constructs a new Graph, optionally with custom hash and equality semantics
(hash vertex) and (equals? vertex1 vertex2).
sourceraw docstring

inclj

(in g v)

The set of all vertices that lead directly into this vertex.

The set of all vertices that lead directly into this vertex.
sourceraw docstring

index-ofclj

(index-of g v)

Returns the index of the given vertex, if present, or nil.

Returns the index of the given vertex, if present, or nil.
sourceraw docstring

(link g from to)
(link g from to e)
(link g from to e merge)

Returns graph with vertex from linked to to, optionally via edge e, optionally with e merged into an existing edge via (merge extant-edge e).

Returns graph with vertex `from` linked to `to`, optionally via edge `e`,
optionally with `e` merged into an existing edge via `(merge extant-edge e)`.
sourceraw docstring

map-edgesclj

(map-edges g f)

Transforms every edge's value by applying (f edge) -> value'

Transforms every edge's value by applying (f edge) -> value'
sourceraw docstring

mergeclj

(merge a b merge-fn)

Merges two graphs together using a function (merge-fn edge-value1 edge-value2).

Merges two graphs together using a function (merge-fn edge-value1
edge-value2).
sourceraw docstring

outclj

(out g v)

The set of all vertices this vertex directly leads to.

The set of all vertices this vertex directly leads to.
sourceraw docstring

removeclj

(remove g x)

Removes a vertex from the graph.

Removes a vertex from the graph.
sourceraw docstring

selectclj

(select g vertices)

A graph containing only the specified vertices and the edges between them.

A graph containing only the specified vertices and the edges between them.
sourceraw docstring

shortest-pathclj

(shortest-path g start accept? cost)

Finds the shortest path, if one exists, from starting vertex to any vertex where (accept? v) is truthy, using (cost edge) -> double to determine the cost of each edge. Nil if no path exists.

Finds the shortest path, if one exists, from starting vertex to any vertex
where (accept? v) is truthy, using (cost edge) -> double to determine the
cost of each edge. Nil if no path exists.
sourceraw docstring

shortest-path-from-anyclj

(shortest-path-from-any g starts accept? cost)

Finds the shortest path, if one exists, from any one of an iterable of starting vertices to any vertex where (accept? v) is truthy, using (cost edge) -> double to determine the cost of each edge. Nil if no path exists.

Finds the shortest path, if one exists, from any one of an iterable of
starting vertices to any vertex where (accept? v) is truthy, using (cost
edge) -> double to determine the cost of each edge. Nil if no path exists.
sourceraw docstring

strongly-connected-componentsclj

(strongly-connected-components g)
(strongly-connected-components g include-singletons?)

Sets of sets of vertices where each vertex can reach every other vertex in that set. include-singletons? indicates whether single-vertex sets are allowed.

Sets of sets of vertices where each vertex can reach every other vertex in
that set. include-singletons? indicates whether single-vertex sets are
allowed.
sourceraw docstring

strongly-connected-subgraphsclj

(strongly-connected-subgraphs g)
(strongly-connected-subgraphs g include-singletons?)

A list of graphs of strongly connected components in g. include-singletons? indicates whether single-vertex sets are allowed.

A list of graphs of strongly connected components in g. include-singletons?
indicates whether single-vertex sets are allowed.
sourceraw docstring

topclj

(top g)

This appears to be the vertices which have no in edges.

This appears to be the vertices which have no in edges.
sourceraw docstring

transposeclj

(transpose g)

Transposes a graph, flipping the direction of each edge.

Transposes a graph, flipping the direction of each edge.
sourceraw docstring

undirected-edgeclj

(undirected-edge from to)
(undirected-edge from to value)

Constructs a new undirected edge with an optional value.

Constructs a new undirected edge with an optional value.
sourceraw docstring

(unlink g from to)

Removes the link between from and to.

Removes the link between `from` and `to`.
sourceraw docstring

vertex-equalityclj

(vertex-equality g)

Returns the vertex equality function of a graph

Returns the vertex equality function of a graph
sourceraw docstring

vertex-hashclj

(vertex-hash g)

Returns the vertex hash function of a graph.

Returns the vertex hash function of a graph.
sourceraw docstring

verticesclj

(vertices g)

The set of all vertices in the graph

The set of all vertices in the graph
sourceraw docstring

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

× close