profile
Computes the profile of a graph, which is the sum of all vertex bandwidths plus one for each vertex.
Complexity: O(|V| * max_out_degree)
Defined in: <boost/graph/profile.hpp>
Example
#include <iostream>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/profile.hpp>
int main() {
using Graph = boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS>;
Graph g{5};
boost::add_edge(0, 1, g);
boost::add_edge(1, 2, g);
boost::add_edge(0, 4, g);
boost::add_edge(3, 4, g);
auto p = boost::profile(g);
std::cout << "Profile: " << p << "\n";
}
Profile: 16
(1) Default vertex index overload
template <typename Graph>
typename graph_traits<Graph>::vertices_size_type
profile(const Graph& g)
| Direction | Parameter | Description |
|---|---|---|
IN |
|
The graph object on which the algorithm will be applied.
The type |
(2) Explicit vertex index map overload
template <typename Graph, typename VertexIndexMap>
typename graph_traits<Graph>::vertices_size_type
profile(const Graph& g, VertexIndexMap index_map)
| Direction | Parameter | Description |
|---|---|---|
IN |
|
The graph object on which the algorithm will be applied.
The type |
IN |
|
This maps each vertex to an integer in the range |
Description
The profile of a graph is the sum of all the maximum distances between the i-th vertex and any of its neighbors with an index j>i, plus one for each vertex. More precisely, the profile is the sum of all individual vertex bandwidths plus one:
P(G) = sum { Bi(G) + 1 | i=0…|V|-1 }
where Bi(G) is the i-th bandwidth.