Liking cljdoc? Tell your friends :D

idm.graph.alg

Algorithms for traversing the graph

Algorithms for traversing the graph
raw docstring

add-default-paramsclj

(add-default-params g opts)

Standardize the options map for least-cost-path

Standardize the options map for least-cost-path
raw docstring

find-multipathclj

(find-multipath backlinks & targets)

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 params)
(least-cost-path g start-node end-node)
(least-cost-path g start-node end-node cost-attr)

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

Arguments: g: graph params: map of parameters, with defaults provided by add-default-params

  • start-nodes: set of initial, known nodes
  • end-nodes: set of nodes to end at
  • traverse?: when true, requires all end-nodes be reached before terminating; otherwise, terminates on first node
  • may-final-edge? function indicating whether nor not a given edge may be the last one in the path
  • cost-fn: function providing cost of a given edge
  • node-filter: function returning true for allowed nodes
  • edge-filter: function returning true for allowed edges
  • final-node?: function instructing immediate termination for a node returning true, provided its edge passes may-final-edge?

If end-nodes not provided:

  • and final-node? is provided, will exit on first matching node. final-node? is otherwise not used.
  • otherwise, traverse? is assumed and all possible edges will be visited before exiting Otherwise, if traverse? is true, will attempt to visit all nodes in end-nodes before exiting; if false, will exit on first node in end-nodes.
Finds the cheapest path satisfying the given constraints. Respects mult-edge
relations (idm.graph.relation/[one->one, many->one, one->many])

Arguments:
`g`: graph
`params`: map of parameters, with defaults provided by `add-default-params`
  - `start-nodes`: set of initial, known nodes
  - `end-nodes`: set of nodes to end at
  - `traverse?`: when true, requires all `end-nodes` be reached before
    terminating; otherwise, terminates on first node
  - `may-final-edge?` function indicating whether nor not a given edge may be
    the last one in the path
  - `cost-fn`: function providing cost of a given edge
  - `node-filter`: function returning true for allowed nodes
  - `edge-filter`: function returning true for allowed edges
  - `final-node?`: function instructing immediate termination for a node
    returning true, provided its edge passes `may-final-edge?`

If `end-nodes` not provided:
  - and `final-node?` is provided, will exit on first matching node.
    `final-node?` is otherwise not used.
  - otherwise, `traverse?` is assumed and all possible edges will be visited
    before exiting
Otherwise, if `traverse?` is true, will attempt to visit all nodes in
`end-nodes` before exiting; if false, will exit on first node in `end-nodes`.
raw docstring

least-cost-path-wrapperclj


Multipathclj


pprint-multipathclj

(pprint-multipath multipath)

Pretty-print a multipath

Pretty-print a multipath
raw docstring

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

× close