Liking cljdoc? Tell your friends :D

ubergraph.core


add-attrclj

(add-attr g node-or-edge k v)
(add-attr g n1 n2 k v)

Add an attribute to node or edge

Add an attribute to node or edge
sourceraw docstring

add-attrsclj

(add-attrs g node-or-edge attribute-map)
(add-attrs g n1 n2 attribute-map)

Merges an attribute map with the existing attributes of a node or edge

Merges an attribute map with the existing attributes of a node or edge
sourceraw docstring

add-directed-edgesclj

(add-directed-edges g & edges)

Adds directed edges, regardless of whether the underlying graph is directed or undirected

Adds directed edges, regardless of whether the underlying graph is directed or undirected
sourceraw docstring

add-directed-edges*clj

(add-directed-edges* g edges)

Adds directed edges regardless of the graph's undirected/directed default

Adds directed edges regardless of the graph's undirected/directed default
sourceraw docstring

add-edgesclj

(add-edges g & edges)

Adds edges to graph g of the form [n1 n2], [n1 n2 weight], or [n1 n2 attr-map].

Adds edges to graph g of the form [n1 n2], [n1 n2 weight], or [n1 n2 attr-map].
sourceraw docstring

add-edges*clj

(add-edges* g edges)

Add edges to graph g. See add-edges

Add edges to graph g. See add-edges
sourceraw docstring

add-nodesclj

(add-nodes g & nodes)

Adds nodes to graph g. Nodes can be any type of object

Adds nodes to graph g. Nodes can be any type of object
sourceraw docstring

add-nodes*clj

(add-nodes* g nodes)

Add nodes to graph g. See add-nodes

Add nodes to graph g. See add-nodes
sourceraw docstring

add-nodes-with-attrsclj

(add-nodes-with-attrs g & nodes-with-attrs)

Takes any number of [node attr-map] pairs, and adds them to graph g.

Takes any number of [node attr-map] pairs, and adds them to graph g.
sourceraw docstring

add-nodes-with-attrs*clj

(add-nodes-with-attrs* g nodes-with-attrs)

Takes a sequence of [node attr-map] pairs, and adds them to graph g.

Takes a sequence of [node attr-map] pairs, and adds them to graph g.
sourceraw docstring

add-undirected-edgesclj

(add-undirected-edges g & edges)

Adds undirected edges, regardless of whether the underlying graph is directed or undirected

Adds undirected edges, regardless of whether the underlying graph is directed or undirected
sourceraw docstring

add-undirected-edges*clj

(add-undirected-edges* g edges)

Adds undirected edges regardless of the graph's undirected/directed default

Adds undirected edges regardless of the graph's undirected/directed default
sourceraw docstring

allow-parallel-edges?clj

(allow-parallel-edges? g)

If true, two edges between the same pair of nodes in the same direction are permitted. If false, adding a new edge between the same pair of nodes as an existing edge will merge the edges into a single edge, and adding an undirected edge on top of an existing directed edge will `upgrade' the directed edge to undirected and merge attributes.

If true, two edges between the same pair of nodes in the same direction
are permitted.  If false, adding a new edge between the same pair of nodes as an existing edge will
merge the edges into a single edge, and adding an undirected edge on top of an existing directed edge
will `upgrade' the directed edge to undirected and merge attributes.
sourceraw docstring

attrclj

(attr g node-or-edge k)
(attr g n1 n2 k)

Return the attribute on a node or edge

Return the attribute on a node or edge
sourceraw docstring

attrsclj

(attrs g node-or-edge)
(attrs g n1 n2)

Return all attributes on a node or edge

Return all attributes on a node or edge
sourceraw docstring

build-graphclj

(build-graph g & inits)

Builds graphs using node descriptions of the form node-label or [node-label attribute-map] and edge descriptions of the form [src dest], [src dest weight], or [src dest attribute-map]. Also can build from other ubergraphs and from adjacency maps.

Use ^:node and ^:edge metadata to resolve ambiguous inits, or build your graph with the more precise add-nodes, add-nodes-with-attrs, and add-edges functions.

Builds graphs using node descriptions of the form node-label or [node-label attribute-map]
and edge descriptions of the form [src dest], [src dest weight], or [src dest attribute-map].
Also can build from other ubergraphs and from adjacency maps.

Use ^:node and ^:edge metadata to resolve ambiguous inits, or build your graph with the more
precise add-nodes, add-nodes-with-attrs, and add-edges functions.
sourceraw docstring

count-edgesclj

(count-edges g)

Counts how many edges are in g. Undirected edges are counted twice, once for each direction.

Counts how many edges are in g.
Undirected edges are counted twice, once for each direction.
sourceraw docstring

count-nodesclj

(count-nodes g)

Counts how many nodes are in g

Counts how many nodes are in g
sourceraw docstring

count-unique-edgesclj

(count-unique-edges g)

Counts how many edges are in g. Undirected edges are counted only once.

Counts how many edges are in g.
Undirected edges are counted only once.
sourceraw docstring

destclj

(dest edge)

Returns the dest node of the edge

Returns the dest node of the edge
sourceraw docstring

digraphclj

(digraph & inits)

Digraph constructor. See build-graph for description of valid inits

Digraph constructor. See build-graph for description of valid inits
sourceraw docstring

directed-edge?clj

(directed-edge? e)

Is e a directed edge?

Is e a directed edge?
sourceraw docstring

edge-description->edgeclj

(edge-description->edge g ed)

Many ubergraph functions can take either an edge description (i.e., [src dest] [src dest weight] or [src dest attribute-map]) or an actual edge object. This function is used to convert edge descriptions into an edge object, or passing through an edge object unchanged, so regardless of what you pass in, you're guaranteed to get out an edge object.

Many ubergraph functions can take either an *edge description* (i.e., [src dest]
[src dest weight] or [src dest attribute-map]) or an actual edge object.  This function
is used to convert edge descriptions into an edge object, or passing through an edge
object unchanged, so regardless of what you pass in, you're guaranteed to get out
an edge object.
sourceraw docstring

edge-with-attrsclj

(edge-with-attrs g edge)

Returns [src dest attribute-map] with ^:edge metadata so it can be safely used as an input to build-graph

Returns [src dest attribute-map] with ^:edge metadata so it can be safely used as an input to build-graph
sourceraw docstring

edge?clj

(edge? o)

Tests whether o is an edge object

Tests whether o is an edge object
sourceraw docstring

edgesclj

(edges g)

Edges in g. May return each edge twice in an undirected graph

Edges in g. May return each edge twice in an undirected graph
sourceraw docstring

edn->ubergraphclj

(edn->ubergraph {:keys [allow-parallel? undirected? nodes directed-edges
                        undirected-edges]})
source

escape-labelclj

(escape-label s)

Takes a string intended to be used as a node or edge label in a Graphviz graph, and returns a string with several characters that cause problems for Graphviz with suitable replacements. Called for you automatically if you use the ':auto-label true' option of the viz-graph function, but you may want to use it for label strings you provide to viz-graph when you do not use that option.

Takes a string intended to be used as a node or edge label in a
Graphviz graph, and returns a string with several characters that
cause problems for Graphviz with suitable replacements.  Called for
you automatically if you use the ':auto-label true' option of the
viz-graph function, but you may want to use it for label strings you
provide to viz-graph when you do not use that option.
sourceraw docstring

find-edgeclj

(find-edge g query)
(find-edge g src dest)

Returns first edge that matches the query

Returns first edge that matches the query
sourceraw docstring

find-edgesclj

(find-edges g query)
(find-edges g src dest)

Returns all edges that match the query

Returns all edges that match the query
sourceraw docstring

graphclj

(graph & inits)

Graph constructor. See build-graph for description of valid inits

Graph constructor. See build-graph for description of valid inits
sourceraw docstring

has-edge?clj

(has-edge? g n1 n2)

Returns true when edge [n1 n2] is in g

Returns true when edge [n1 n2] is in g
sourceraw docstring

has-node?clj

(has-node? g node)

Returns true when node is in g

Returns true when node is in g
sourceraw docstring

in-degreeclj

(in-degree g node)

Returns the number of direct predecessors to node

Returns the number of direct predecessors to node
sourceraw docstring

in-edgesclj

(in-edges g node)

Returns all the incoming edges of node

Returns all the incoming edges of node
sourceraw docstring

mirror-edge?clj

(mirror-edge? e)

Is e the mirrored half of the undirected edge?

Is e the mirrored half of the undirected edge?
sourceraw docstring

multidigraphclj

(multidigraph & inits)

Multidigraph constructor. See build-graph for description of valid inits

Multidigraph constructor. See build-graph for description of valid inits
sourceraw docstring

multigraphclj

(multigraph & inits)

Multigraph constructor. See build-graph for description of valid inits

Multigraph constructor. See build-graph for description of valid inits
sourceraw docstring

neighborsclj

(neighbors g node)

Returns seq of nodes that are either successors or predecessors of the node

Returns seq of nodes that are either successors or predecessors of the node
sourceraw docstring

node-with-attrsclj

(node-with-attrs g node)

Returns [node attribute-map] with ^:node metadata so it can be safely used as an input to build-graph

Returns [node attribute-map] with ^:node metadata so it can be safely used as an input to build-graph
sourceraw docstring

nodesclj

(nodes g)

Returns a collection of the nodes in graph g

Returns a collection of the nodes in graph g
sourceraw docstring

other-directionclj

(other-direction g edge)

Returns the other direction of this edge in graph g

Returns the other direction of this edge in graph g
sourceraw docstring

out-degreeclj

(out-degree g node)

Returns the number of outgoing edges of node

Returns the number of outgoing edges of node
sourceraw docstring

out-edgesclj

(out-edges g node)

Returns all the outgoing edges of node

Returns all the outgoing edges of node
sourceraw docstring

pprintclj

(pprint g)

Pretty print an ubergraph

Pretty print an ubergraph
sourceraw docstring

predecessorsclj

(predecessors g)
(predecessors g node)

Returns direct predecessors of node

Returns direct predecessors of node
sourceraw docstring

predecessors*clj

(predecessors* g node)

Returns direct predecessors of node

Returns direct predecessors of node
sourceraw docstring

remove-allclj

(remove-all g)

Removes all nodes and edges from graph g

Removes all nodes and edges from graph g
sourceraw docstring

remove-attrclj

(remove-attr g node-or-edge k)
(remove-attr g n1 n2 k)

Remove an attribute from a node or edge

Remove an attribute from a node or edge
sourceraw docstring

remove-attrsclj

(remove-attrs g node-or-edge attributes)
(remove-attrs g n1 n2 attributes)

Removes the attributes from the node or edge

Removes the attributes from the node or edge
sourceraw docstring

remove-edgesclj

source

remove-edges*clj

(remove-edges* g edges)

Removes edges from graph g. See remove-edges

Removes edges from graph g. See remove-edges
sourceraw docstring

remove-nodesclj

(remove-nodes g & nodes)

Removes nodes from graph g

Removes nodes from graph g
sourceraw docstring

remove-nodes*clj

(remove-nodes* g nodes)

Remove nodes from graph g. See remove-nodes

Remove nodes from graph g. See remove-nodes
sourceraw docstring

set-attrsclj

(set-attrs g node-or-edge attribute-map)
(set-attrs g n1 n2 attribute-map)

Sets the attribute map of a node or edge, overwriting existing attribute map

Sets the attribute map of a node or edge, overwriting existing attribute map
sourceraw docstring

srcclj

(src edge)

Returns the source node of the edge

Returns the source node of the edge
sourceraw docstring

successorsclj

(successors g)
(successors g node)

Returns direct successors of node

Returns direct successors of node
sourceraw docstring

successors*clj

(successors* g node)

Returns direct successors of node

Returns direct successors of node
sourceraw docstring

transposeclj

(transpose g)

Returns a graph with all edges reversed

Returns a graph with all edges reversed
sourceraw docstring

ubergraphclj

(ubergraph allow-parallel? undirected? & inits)

General ubergraph construtor. Takes booleans for allow-parallel? and undirected? to call either graph, digraph, multigraph, or multidigraph. See build-graph for description of valid inits

General ubergraph construtor. Takes booleans for allow-parallel? and undirected? to
call either graph, digraph, multigraph, or multidigraph.
See build-graph for description of valid inits
sourceraw docstring

ubergraph->ednclj

(ubergraph->edn g)
source

ubergraph?clj

(ubergraph? g)
source

undirected-edge?clj

(undirected-edge? e)

Is e one 'direction' of an undirected edge?

Is e one 'direction' of an undirected edge?
sourceraw docstring

undirected-graph?clj

(undirected-graph? g)

If true, new edges in g are undirected by default. If false, new edges in g are directed by default.

If true, new edges in g are undirected by default.  If false,
new edges in g are directed by default.
sourceraw docstring

viz-graphclj

(viz-graph g)
(viz-graph g
           {layout :layout
            {filename :filename format :format :as save} :save
            auto-label :auto-label
            :as opts
            :or {layout :dot}})

Uses graphviz to generate a visualization of your graph. Graphviz must be installed on your computer and in your path. Passes along to graphviz the attributes on the nodes and edges, so graphviz-related attributes such as color, style, label, etc. will be respected.

Takes an optional map which can contain: :auto-label true (labels each node/edge with its attribute map) :layout :dot, :neato, :fdp, :sfdp, :twopi, or :circo :save {:filename _, :format _} where format is one of :bmp :dot :eps :gif :ico :jpg :jpeg :pdf :png :ps :ps2 :svgz :tif :tiff :vmlz :wbmp Additionally map can contain graph attributes for graphviz like :bgcolor, :label, :splines, ...

Uses graphviz to generate a visualization of your graph. Graphviz
must be installed on your computer and in your path. Passes along
to graphviz the attributes on the nodes and edges, so graphviz-related
attributes such as color, style, label, etc. will be respected.

Takes an optional map which can contain:
:auto-label true (labels each node/edge with its attribute map)
:layout :dot, :neato, :fdp, :sfdp, :twopi, or :circo
:save {:filename _, :format _} where format is one of
:bmp :dot :eps :gif :ico :jpg :jpeg :pdf :png :ps :ps2 :svgz :tif :tiff :vmlz :wbmp
Additionally map can contain graph attributes for graphviz like :bgcolor, :label, :splines, ...
sourceraw docstring

weightclj

(weight g)
(weight g e)
(weight g n1 n2)

Returns the weight of edge e or edge [n1 n2]

Returns the weight of edge e or edge [n1 n2]
sourceraw docstring

weight*clj

(weight* g e)
(weight* g n1 n2)

Returns the weight of edge e or edge [n1 n2]

Returns the weight of edge e or edge [n1 n2]
sourceraw docstring

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

× close