Functions | |
Graph | getCompactedGraph (const Graph &graph, std::unordered_map< node, node > &nodeIdMap) |
Computes a graph with the same structure but with continuous node ids. More... | |
std::unordered_map< node, node > | getContinuousNodeIds (const Graph &graph) |
Computes a map of node ids. More... | |
std::unordered_map< node, node > | getRandomContinuousNodeIds (const Graph &graph) |
Computes a map of random node ids. More... | |
std::vector< node > | invertContinuousNodeIds (std::unordered_map< node, node > &nodeIdMap, const Graph &G) |
Inverts a given mapping of node ids from a graph with deleted nodes to continuous node ids. More... | |
Graph | restoreGraph (std::vector< node > &invertedIdMap, const Graph &G) |
Constructs a new graph that has the same node ids as before it was compacted. More... | |
Graph NetworKit::GraphTools::getCompactedGraph | ( | const Graph & | graph, |
std::unordered_map< node, node > & | nodeIdMap | ||
) |
Computes a graph with the same structure but with continuous node ids.
graph | The graph to be compacted. |
nodeIdMap | The map providing the information about the node ids. |
Computes a map of node ids.
graph | The graph of which the node id map is wanted. |
std::unordered_map< node, node > NetworKit::GraphTools::getRandomContinuousNodeIds | ( | const Graph & | graph | ) |
Computes a map of random node ids.
graph | The graph of which the node id map is wanted. |
std::vector< node > NetworKit::GraphTools::invertContinuousNodeIds | ( | std::unordered_map< node, node > & | nodeIdMap, |
const Graph & | G | ||
) |
Inverts a given mapping of node ids from a graph with deleted nodes to continuous node ids.
nodeIdMap | The mapping from node ids with gaps to continuous node ids (i.e. from ) |
G | The compacted graph (currently only needed for the upper node id bound) |
Graph NetworKit::GraphTools::restoreGraph | ( | std::vector< node > & | invertedIdMap, |
const Graph & | G | ||
) |
Constructs a new graph that has the same node ids as before it was compacted.
invertedIdMap | The node id mapping from continuous node ids to noncontinuous node ids. |
G | The compacted graph. |