Liking cljdoc? Tell your friends :D

cljgrapht.core

Idiomatic construction and inspection of graphs backed by JGraphT.

Vertices are arbitrary Clojure values (keywords, strings, numbers, maps). Graphs are JGraphT's native mutable objects: constructors and mutators return the same graph for threading, but they mutate in place (this is a performance wrapper, not a persistent data structure). Algorithms live in cljgrapht.algo and return plain Clojure data.

Idiomatic construction and inspection of graphs backed by JGraphT.

Vertices are arbitrary Clojure values (keywords, strings, numbers, maps).
Graphs are JGraphT's native mutable objects: constructors and mutators return
the same graph for threading, but they mutate in place (this is a performance
wrapper, not a persistent data structure). Algorithms live in `cljgrapht.algo`
and return plain Clojure data.
raw docstring

add-edgeclj

(add-edge g u v)
(add-edge g u v w)

Add an edge u -> v (optionally with weight w) to g, adding the vertices if absent. Returns g.

Add an edge `u -> v` (optionally with weight `w`) to `g`, adding the vertices
if absent. Returns `g`.
sourceraw docstring

add-vertexclj

(add-vertex g v)

Add vertex v to g, returning g.

Add vertex `v` to `g`, returning `g`.
sourceraw docstring

digraphclj

(digraph)
(digraph edges)

A directed graph. Optional edges is a seq of [u v] pairs.

A directed graph. Optional `edges` is a seq of [u v] pairs.
sourceraw docstring

edgesclj

(edges g)

A seq of edges in g: [u v] pairs, or [u v w] triples when g is weighted.

A seq of edges in `g`: [u v] pairs, or [u v w] triples when `g` is weighted.
sourceraw docstring

graphclj

(graph)
(graph edges)

An undirected graph. Optional edges is a seq of [u v] pairs.

An undirected graph. Optional `edges` is a seq of [u v] pairs.
sourceraw docstring

neighborsclj

(neighbors g v)

Vertices adjacent to v in g (direction-agnostic).

Vertices adjacent to `v` in `g` (direction-agnostic).
sourceraw docstring

predecessorsclj

(predecessors g v)

Vertices with an edge into v in g.

Vertices with an edge into `v` in `g`.
sourceraw docstring

successorsclj

(successors g v)

Vertices reachable from v by an outgoing edge in g.

Vertices reachable from `v` by an outgoing edge in `g`.
sourceraw docstring

verticesclj

(vertices g)

The set of vertices in g.

The set of vertices in `g`.
sourceraw docstring

weightclj

(weight g u v)

The weight of the edge u -> v in g.

The weight of the edge `u -> v` in `g`.
sourceraw docstring

weighted-digraphclj

(weighted-digraph)
(weighted-digraph edges)

A directed weighted graph. Optional edges is a seq of [u v w] triples.

A directed weighted graph. Optional `edges` is a seq of [u v w] triples.
sourceraw docstring

weighted-graphclj

(weighted-graph)
(weighted-graph edges)

An undirected weighted graph. Optional edges is a seq of [u v w] triples.

An undirected weighted graph. Optional `edges` is a seq of [u v w] triples.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close