Class graph::input_graph¶
-
class graph
input_graph¶ Represents an undirected graph as a list of edges.
Provides methods to extract those edges into neighbor lists (with options to relabel and produce directed graphs).
As an input to the library this may be a disconnected graph, but when returned from components it is a connected sub graph.
Public Functions
-
graph::input_graph
input_graph()¶ Constructs an empty graph.
-
graph::input_graph
input_graph(int n_v, const vector<int> &aside, const vector<int> &bside)¶ Constructs a graph from the provided edges.
The ends of edge ii are aside[ii] and bside[ii].
- Parameters
n_v: Number of nodes in the graph.aside: List of nodes describing edges.bside: List of nodes describing edges.
-
void graph::input_graph
clear()¶ Remove all edges and nodes from a graph.
-
int graph::input_graph
a(const int i) const¶ Return the nodes on either end of edge
i
-
int graph::input_graph
b(const int i) const¶ Return the nodes on either end of edge
i
-
int graph::input_graph
num_nodes() const¶ Return the size of the graph in nodes.
-
int graph::input_graph
num_edges() const¶ Return the size of the graph in edges.
-
void graph::input_graph
push_back(int ai, int bi)¶ Add an edge to the graph.
-
void graph::input_graph
get_neighbors_sources(vector<vector<int>> &nbrs, const vector<int> &sources) const¶ produce the node->nodelist mapping for our graph, where certain nodes are marked as sources (no incoming edges)
-
void graph::input_graph
get_neighbors_sinks(vector<vector<int>> &nbrs, const vector<int> &sinks) const¶ produce the node->nodelist mapping for our graph, where certain nodes are marked as sinks (no outgoing edges)
-
void graph::input_graph
get_neighbors_sinks_relabel(vector<vector<int>> &nbrs, const vector<int> &sinks, const vector<int> &relabel) const¶ produce the node->nodelist mapping for our graph, where certain nodes are marked as sinks (no outgoing edges), relabeling all nodes along the way
-
void graph::input_graph
get_neighbors_relabel(vector<vector<int>> &nbrs, const vector<int> &relabel) const¶ produce the node->nodelist mapping for our graph, relabeling all nodes along the way
-
void graph::input_graph
get_neighbors(vector<vector<int>> &nbrs) const¶ produce the node->nodelist mapping for our graph
-
graph::input_graph