Module: lopaths.graph
Module: lopaths.graph#
Module implementing objects representing graphs and different algorithms to find shortest and potential alternative paths.
Data:
Number of CPU cores to be used at most. |
Classes:
|
|
|
Graph with a flexible structure that supports efficient addition and removal of vertices and edges. |
|
- CPU_COUNT = 8#
Number of CPU cores to be used at most. Defaults to the number of installed cores.
- class FastGraph(flexibleGraph)[source]#
Bases:
vemomoto_core.tools.saveobject.SeparatelySaveableMethods:
add_edge(fromIndex, toIndex, edgeData)add_edge_attributes(names, dtypes[, fillVal])add_vertex(vertexData)add_vertex_attributes(names, dtypes[, fillVal])remove_edge(fromIndex, toIndex)remove_vertex(vertexIndex)
- class FlexibleGraph(edges, edgeData, vertices, vertexData, replacementMode='overwrite', lengthLabel=None, significanceLabel=None, defaultVertexData=None, defaultEdgeData=None, **printerArgs)[source]#
Bases:
vemomoto_core.tools.hrprint.HierarchichalPrinterGraph with a flexible structure that supports efficient addition and removal of vertices and edges.
Methods:
add_edge(fromID, toID[, edgeData])add_edge_attributes(names, dtypes[, fillVal])add_vertex(vertexID[, vertexData])add_vertex_attributes(names, dtypes[, fillVal])get_edge_data(fromID, toID[, copy])get_neighbor_edges(vertexID[, ...])get_predecessors(vertexID)get_successors(vertexID)get_vertex_data(vertexID[, copy])remove_edge(fromID, toID)remove_vertex(vertexID[, counter])set_default_edge_data([data])set_default_vertex_data([data])set_edge_data(fromID, toID, data)set_vertex_data(vertexID, data)
- class FlowPointGraph(flexibleGraph, lengthLabel, significanceLabel=None, **printerArgs)[source]#
Bases:
lopaths.graph.FastGraph,vemomoto_core.tools.hrprint.HierarchichalPrinter,vemomoto_core.concurrent.nicepar.LockableMethods:
find_alternative_paths(*args, **kwargs)find_locally_optimal_paths(fromIndices, ...)find_shortest_distance_array(fromIndices, ...)find_shortest_path(fromIndex, toIndex[, ...])preprocessing(initialBound[, boundFactor, ...])