Liking cljdoc? Tell your friends :D

idm.graph.alg

Algorithms for traversing the graph

Algorithms for traversing the graph
raw docstring

all-multipathsclj

(all-multipaths backlinks costs)

Prepare an ubergraph-compatible representation of all possible multipaths based on a priority map of visited edges and a map of edge->siblings

Prepare an ubergraph-compatible representation of all possible multipaths
based on a priority map of visited edges and a map of edge->siblings
raw docstring

arborescenceclj

(arborescence G r w)

Calculate an arborescence in D rooted at r with cost fn w. Minimum spanning tree algorithm for a directed graph. See https://en.wikipedia.org/wiki/Edmonds%27_algorithm

w should be a function of the edge attributes map

Calculate an arborescence in `D` rooted at `r` with cost fn `w`.
Minimum spanning tree algorithm for a directed graph.
See https://en.wikipedia.org/wiki/Edmonds%27_algorithm

`w` should be a function of the edge attributes map
raw docstring

e->strclj

(e->str e)

Debug representation of an edge. Ignores attributes.

Debug representation of an edge. Ignores attributes.
raw docstring

edge->vectorclj

(edge->vector edge)

Convert an Ubergraph edge to a vector of the form [src dest attrs], using the graph, which is stored on a given edge as metadata (usually) to retrieve the attributes.

Convert an Ubergraph edge to a vector of the form [src dest attrs], using
the graph, which is stored on a given edge as metadata (usually) to retrieve
the attributes.
raw docstring

find-multipathclj

(find-multipath edge-or-rel backlinks)

Given the final relation id in a path, return a sequence of relation ids or sets of relation ids from the initial node(s) to the final relation.

Given the final *relation id* in a path, return a sequence of relation ids
or sets of relation ids from the initial node(s) to the final relation.
raw docstring

least-cost-pathclj

(least-cost-path g
                 starting-nodes
                 goal?
                 may-final-edge?
                 cost-fn
                 node-filter
                 edge-filter)

Finds the cheapest path satisfying the given constraints. Respects mult-edge relations (idm.graph.relation/[one->one, many->one, one->many])

Arguments: g: graph starting-nodes: set of initial, known nodes goal?: function returning truthy value if a node is the target may-final-edge?: function indicating whether or not a given edge may be final cost-fn: function providing cost of a given edge node-filter: function returning true when a given node is allowed edge-filter: function returning true when a given edge is allowed

Finds the cheapest path satisfying the given constraints. Respects mult-edge
relations (idm.graph.relation/[one->one, many->one, one->many])

Arguments:
`g`: graph
`starting-nodes`: set of initial, known nodes
`goal?`: function returning truthy value if a node is the target
`may-final-edge?`: function indicating whether or not a given edge may be final
`cost-fn`: function providing cost of a given edge
`node-filter`: function returning true when a given node is allowed
`edge-filter`: function returning true when a given edge is allowed
raw docstring

least-cost-path-wrapperclj

(least-cost-path-wrapper g opts)
(least-cost-path-wrapper g start-node end-node)
(least-cost-path-wrapper g start-node end-node cost-attr)

Wrapper function for least-cost-path and similar to work with and standardize the many options available.

Wrapper function for least-cost-path and similar to work with and
standardize the many options available.
raw docstring

msp-directedclj

(msp-directed graph root cost-fn)

multipathclj

(multipath backlinks costs last-edge last-rel)

Create an object satisfying Ubergraph's IPath as well as IMultipath to represent a multipath.

Create an object satisfying Ubergraph's IPath as well as IMultipath to
represent a multipath.
raw docstring

Multipathcljprotocol

Functions going beyond the Ubergraph IPath protocol to deal with extended requirements, such as retrieving lists of relations etc.

Functions going beyond the Ubergraph IPath protocol to deal with extended
requirements, such as retrieving lists of relations etc.

edge-setsclj

(edge-sets path)

A list of edge sets comprising a full traversal of this multipath. Even single edges will be wrapped in a set.

A list of edge sets comprising a full traversal of this multipath. Even
single edges will be wrapped in a set.

pathclj

(path path)

Get a vector of edges and relations in this multipath. For a path with only one->one edges, equivalent to [[alg/edges-in-path]]

Get a vector of edges and relations in this multipath. For a
path with only one->one edges, equivalent to [[alg/edges-in-path]]

relationsclj

(relations path)

A list of relations in this path

A list of relations in this path
raw docstring

no-goalclj

Value indicating no actual goal

Value indicating no actual goal
raw docstring

pprint-multipathclj

(pprint-multipath multipath)

Pretty-print a multipath

Pretty-print a multipath
raw docstring

queue-entry->strclj

(queue-entry->str [edge prev-edge cost])

Convert an entry in the priority queue into a string

Convert an entry in the priority queue into a string
raw docstring

relation-forclj

(relation-for edge)
(relation-for graph edge)

Get the relation an edge belongs to. Relation will include type, id, and member edges.

When graph is not provided, assumes you know this is a one->one edge and completes as such.

Get the relation an edge belongs to. Relation will include type, id, and
member edges.

When `graph` is not provided, assumes you know this is a one->one edge and
completes as such.
raw docstring

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

× close