src/cplib/graph/graph

    Dark Mode
Search:
Group by:
  Source   Edit

Types

DynamicGraph[T] = ref object of RootObj
  edges*: seq[seq[(int32, T)]]
  len*: int
  Source   Edit
StaticGraph[T] = ref object of RootObj
  src*, dst*: seq[int32]
  cost*: seq[T]
  elist*: seq[(int32, T)]
  start*: seq[int32]
  len*: int
  Source   Edit
UnWeightedDirectedGraph = ref object of DynamicGraph[int]
  Source   Edit
UnWeightedDirectedStaticGraph = ref object of StaticGraph[int]
  Source   Edit
UnWeightedDirectedTableGraph[T] = object
  toi*: Table[T, int]
  v*: seq[T]
  graph*: UnWeightedDirectedGraph
  Source   Edit
UnWeightedUnDirectedGraph = ref object of DynamicGraph[int]
  Source   Edit
UnWeightedUnDirectedTableGraph[T] = object
  toi*: Table[T, int]
  v*: seq[T]
  graph*: UnWeightedUnDirectedGraph
  Source   Edit
WeightedDirectedGraph[T] = ref object of DynamicGraph[T]
  Source   Edit
WeightedDirectedStaticGraph[T] = ref object of StaticGraph[T]
  Source   Edit
WeightedDirectedTableGraph[T; S] = object
  toi*: Table[T, int]
  v*: seq[T]
  graph*: WeightedDirectedGraph[S]
  Source   Edit
WeightedUnDirectedGraph[T] = ref object of DynamicGraph[T]
  Source   Edit
WeightedUnDirectedStaticGraph[T] = ref object of StaticGraph[T]
  Source   Edit
WeightedUnDirectedTableGraph[T; S] = object
  toi*: Table[T, int]
  v*: seq[T]
  graph*: WeightedUnDirectedGraph[S]
  Source   Edit

Procs

proc add_edge(g: var UnWeightedDirectedGraph; u, v: int) {....raises: [], tags: [].}
  Source   Edit
proc add_edge(g: var UnWeightedDirectedStaticGraph; u, v: int) {....raises: [],
    tags: [].}
  Source   Edit
proc add_edge(g: var UnWeightedUnDirectedGraph; u, v: int) {....raises: [],
    tags: [].}
  Source   Edit
proc add_edge(g: var UnWeightedUnDirectedStaticGraph; u, v: int) {....raises: [],
    tags: [].}
  Source   Edit
proc add_edge[T, S](g: var WeightedTableGraph[T, S]; u, v: int; cost: S)
  Source   Edit
proc add_edge[T](g: var UnWeightedTableGraph[T]; u, v: int)
  Source   Edit
proc add_edge[T](g: var WeightedDirectedGraph[T]; u, v: int; cost: T)
  Source   Edit
proc add_edge[T](g: var WeightedDirectedStaticGraph[T]; u, v: int; cost: T)
  Source   Edit
proc add_edge[T](g: var WeightedUnDirectedGraph[T]; u, v: int; cost: T)
  Source   Edit
proc add_edge[T](g: var WeightedUnDirectedStaticGraph[T]; u, v: int; cost: T)
  Source   Edit
proc add_edge_dynamic_impl[T](g: DynamicGraph[T]; u, v: int; cost: T;
                              directed: bool)
  Source   Edit
proc add_edge_static_impl[T](g: StaticGraph[T]; u, v: int; cost: T;
                             directed: bool)
  Source   Edit
proc build(g: StaticGraphTypes)
  Source   Edit
proc build_impl[T](g: StaticGraph[T])
  Source   Edit
proc initUnWeightedDirectedGraph(N: int): UnWeightedDirectedGraph {....raises: [],
    tags: [].}
  Source   Edit
proc initUnWeightedDirectedStaticGraph(N: int; capacity: int = 0): UnWeightedDirectedStaticGraph {.
    ...raises: [], tags: [].}
  Source   Edit
proc initUnWeightedUnDirectedGraph(N: int): UnWeightedUnDirectedGraph {.
    ...raises: [], tags: [].}
  Source   Edit
proc initUnWeightedUnDirectedStaticGraph(N: int; capacity: int = 0): UnWeightedUnDirectedStaticGraph {.
    ...raises: [], tags: [].}
  Source   Edit
proc initWeightedDirectedGraph(N: int; edgetype: typedesc = int): WeightedDirectedGraph[
    edgetype]
  Source   Edit
proc initWeightedDirectedStaticGraph(N: int; edgetype: typedesc = int;
                                     capacity: int = 0): WeightedDirectedStaticGraph[
    edgetype]
  Source   Edit
proc initWeightedDirectedTableGraph[T](V: seq[T]; S: typedesc = int): WeightedDirectedTableGraph[
    T, S]
  Source   Edit
proc initWeightedUnDirectedGraph(N: int; edgetype: typedesc = int): WeightedUnDirectedGraph[
    edgetype]
  Source   Edit
proc initWeightedUnDirectedStaticGraph(N: int; edgetype: typedesc = int;
                                       capacity: int = 0): WeightedUnDirectedStaticGraph[
    edgetype]
  Source   Edit
proc initWeightedUnDirectedTableGraph[T](V: seq[T]; S: typedesc = int): WeightedUnDirectedTableGraph[
    T, S]
  Source   Edit
proc len(G: UnWeightedGraph): int
  Source   Edit
proc len[T](G: WeightedGraph[T]): int
  Source   Edit

Iterators

iterator `[]`(g: UnWeightedDirectedGraph or UnWeightedUnDirectedGraph; x: int): int
  Source   Edit
iterator `[]`[T, S](g: WeightedDirectedTableGraph[T, S] or
    WeightedUnDirectedTableGraph[T, S]; x: T): (T, S)
  Source   Edit
iterator `[]`[T](g: UnWeightedDirectedTableGraph[T] or
    UnWeightedUnDirectedTableGraph[T]; x: T): T
  Source   Edit
iterator `[]`[T](g: WeightedDirectedGraph[T] or WeightedUnDirectedGraph[T];
                 x: int): (int, T)
  Source   Edit
iterator `[]`[T](g: WeightedDirectedStaticGraph[T] or
    WeightedUnDirectedStaticGraph[T]; x: int): (int, T)
  Source   Edit
iterator to_and_cost[T](g: DynamicGraph[T]; x: int): (int, T)
  Source   Edit
iterator to_and_cost[T](g: StaticGraph[T]; x: int): (int, T)
  Source   Edit