Class Graph

Inheritance Relationships

Derived Type

Class Documentation

class Graph

Subclassed by f2c::types::Graph2D

Public Functions

Graph &addDirectedEdge(size_t from, size_t to, int64_t cost)
Graph &addEdge(size_t i, size_t j, int64_t cost)
Graph &removeDirectedEdge(size_t from, size_t to)
Graph &removeEdge(size_t i, size_t j)
std::unordered_set<size_t> getNodes() const

Ids of every node, including nodes that only have incoming edges.

size_t numNodes() const
size_t matrixSize() const

Size of the matrices returned by getCosts() and getPaths().

Nodes are indexed by their own id, so this is the largest id plus one.

size_t numEdges() const
map_to_map_to_int getEdges() const
std::vector<size_t> getEdgesFrom(size_t s) const
int64_t getCostFromEdge(size_t from, size_t to, int64_t INF = 1e15) const
std::vector<std::vector<size_t>> allPathsBetween(size_t from, size_t to) const
void shortestPathsAndCosts(int64_t INF = 1e15)
void initializeMatrices(std::vector<std::vector<int64_t>> &cost_dest, std::vector<std::vector<int64_t>> &next_dest, int64_t INF = 1e15)
std::vector<std::vector<int64_t>> &getCosts()
short_path_container_t &getPaths()
std::vector<size_t> shortestPath(size_t from, size_t to, int64_t INF = 1e15)
std::vector<size_t> reconstructPath(size_t from, size_t to, std::vector<std::vector<int64_t>> &next) const
int64_t shortestPathCost(size_t from, size_t to, int64_t INF = 1e15)