test/utils/bruteforce.cpp
/**
 * Construct a graph on n vertices from the given set of edges.
 * 
 * Assumes that the edges use only vertices 0...n-1.
 * 
 * @param n     number of vertices of the resulting graph
 * @param edges the set of edges of the graph
 * @return the graph with given edge set
 */
Construct a graph on n vertices from the given set of edges.

Assumes that the edges use only vertices 0...n-1.

@param n     number of vertices of the resulting graph
@param edges the set of edges of the graph
@return the graph with given edge set
Construct a graph on n vertices from the given set of edges . Assumes that the edges use only vertices 0 ... n - 1 . @param n number of vertices of the resulting graph @param edges the set of edges of the graph @return the graph with given edge set
graph make_graph_with_edges(size_t n, const std::vector<edge>& edges) {
    graph g;
    for (size_t i = 0; i < n; ++i) {
        g.add_node();
    }
    for (auto [u, v] : edges) {
        g.add_edge(u, v);
    }
    return g;
}
graph make_graph_with_edges ( size_t n , const std :: vector < edge > & edges ) { graph g ; for ( size_t i = 0 ; i < n ; ++ i ) { g . add_node ( ) ; } for ( auto [ u , v ] : edges ) { g . add_edge ( u , v ) ; } return g ; }
Construct a graph on n vertices from the given set of edges.
Construct a graph on n vertices from the given set of edges .