Non-Distributed Betweenness Centrality
// named parameter versions
template<typename ProcessGroup, typename Graph, typename Param, typename Tag, typename Rest>
void
non_distributed_brandes_betweenness_centrality(const ProcessGroup& pg, const Graph& g,
const bgl_named_params<Param,Tag,Rest>& params);
template<typename ProcessGroup, typename Graph, typename CentralityMap,
typename Buffer>
void
non_distributed_brandes_betweenness_centrality(const ProcessGroup& pg, const Graph& g,
CentralityMap centrality, Buffer sources);
template<typename ProcessGroup, typename Graph, typename CentralityMap,
typename EdgeCentralityMap, typename Buffer>
void
non_distributed_brandes_betweenness_centrality(const ProcessGroup& pg, const Graph& g,
CentralityMap centrality,
EdgeCentralityMap edge_centrality_map,
Buffer sources);
// non-named parameter versions
template<typename ProcessGroup, typename Graph, typename CentralityMap,
typename EdgeCentralityMap, typename IncomingMap, typename DistanceMap,
typename DependencyMap, typename PathCountMap, typename VertexIndexMap,
typename Buffer>
void
non_distributed_brandes_betweenness_centrality(const ProcessGroup& pg,
const Graph& g,
CentralityMap centrality,
EdgeCentralityMap edge_centrality_map,
IncomingMap incoming,
DistanceMap distance,
DependencyMap dependency,
PathCountMap path_count,
VertexIndexMap vertex_index,
Buffer sources);
template<typename ProcessGroup, typename Graph, typename CentralityMap,
typename EdgeCentralityMap, typename IncomingMap, typename DistanceMap,
typename DependencyMap, typename PathCountMap, typename VertexIndexMap,
typename WeightMap, typename Buffer>
void
non_distributed_brandes_betweenness_centrality(const ProcessGroup& pg,
const Graph& g,
CentralityMap centrality,
EdgeCentralityMap edge_centrality_map,
IncomingMap incoming,
DistanceMap distance,
DependencyMap dependency,
PathCountMap path_count,
VertexIndexMap vertex_index,
WeightMap weight_map,
Buffer sources);
// helper functions
template<typename Graph, typename CentralityMap>
typename property_traits<CentralityMap>::value_type
central_point_dominance(const Graph& g, CentralityMap centrality);
Функция non_distributed_betweenness_centrality() вычисляет центральность между вершинами и краями в графе. Название несколько запутанно, граф g не является распределенным графом, однако алгоритм работает параллельно. Вместо того, чтобы распараллеливать отдельные вычисления кратчайших путей, которые требуются по центральной проходимости, этот вариант алгоритма выполняет вычисления кратчайших путей параллельно с каждым процессом в pg, вычисляя кратчайший путь из другого набора исходных вершин, используя реализацию BGL Dijkstra кратчайших путей. Каждый процесс накапливается в локальной карте централизации, и как только выполняются все самые короткие вычисления путей, выполняется сокращение, чтобы объединить центральность из всех процессов.
<boost/graph/distributed/etweenness_centrality.hpp>
- IN: const ProcessGroup& pg
- The process group over which the the processes involved in
betweenness centrality communicate. The process group type must
model the Process Group concept.
- IN: const Graph& g
- The graph type must be a model of the Incidence Graph concept.
- IN: CentralityMap centrality
A centrality map may be supplied to the algorithm, if one is not
supplied a dummy_property_map will be used and no vertex
centrality information will be recorded. The key type of the
CentralityMap must be the graph's vertex descriptor type.
Default: A dummy_property_map.
- IN: EdgeCentralityMap edge_centrality_map
An edge centrality map may be supplied to the algorithm, if one is
not supplied a dummy_property_map will be used and no edge
centrality information will be recorded. The key type of the
EdgeCentralityMap must be the graph's vertex descriptor type.
Default: A dummy_property_map.
- IN: IncomingMap incoming
The incoming map contains the incoming edges to a vertex that are
part of shortest paths to that vertex. Its key type must be the
graph's vertex descriptor type and its value type must be the
graph's edge descriptor type.
- Default: An iterator_property_map created from a
- std::vector of std::vector of the graph's edge descriptor
type.
- IN: DistanceMap distance
The distance map records the distance to vertices during the
shortest paths portion of the algorithm. Its key type must be the
graph's vertex descriptor type.
- Default: An iterator_property_map created from a
- std::vector of the value type of the CentralityMap.
- IN: DependencyMap dependency
The dependency map records the dependency of each vertex during the
centrality calculation portion of the algorithm. Its key type must
be the graph's vertex descriptor type.
- Default: An iterator_property_map created from a
- std::vector of the value type of the CentralityMap.
- IN: PathCountMap path_count
The path count map records the number of shortest paths each vertex
is on during the centrality calculation portion of the algorithm.
Its key type must be the graph's vertex descriptor type.
- Default: An iterator_property_map created from a
- std::vector of the graph's degree size type.
- IN: VertexIndexMap vertex_index
A model of Readable Property Map whose key type is the vertex
descriptor type of the graph g and whose value type is an
integral type. The property map should map from vertices to their
(local) indices in the range [0, num_vertices(g)).
Default: get(vertex_index, g)
- IN: WeightMap weight_map
- A model of Readable Property Map whose key type is the edge
descriptor type of the graph g. If not supplied the betweenness
centrality calculation will be unweighted.
- IN: Buffer sources
A model of Buffer containing the starting vertices for the
algorithm. If sources is empty a complete betweenness
centrality calculation using all vertices in g will be
performed. The value type of the Buffer must be the graph's vertex
descriptor type.
Default: An empty boost::queue of int.
Каждый из самых коротких путей вычисления O(V log V) и каждый из них может выполняться параллельно (один на процесс в pg). Фаза редукции для вычисления полной централизации в конце фазы кратчайших путей составляет O(V log V).
Алгоритм использует нераспределенный (последовательный) график, а также нераспределенные карты свойств. Каждый процесс содержит отдельную копию последовательного графа g. Чтобы алгоритм был правильным, эти копии g должны быть идентичными. Буфер источников содержит вершины для использования в качестве источника вычисления кратчайших путей единственного источника при приближении между ними централизации с использованием подмножества вершин в графе. Если источники пусты, то производится полный расчет между вершинами.
В последовательной фазе алгоритма каждый процесс вычисляет кратчайшие пути из подмножества вершин в графе, используя методы кратчайших путей Брандеса из реализации BGL. В параллельной фазе алгоритма выполняется сокращение для суммирования значений, вычисленных каждым процессом для всех вершин на графике.
Вычисляется либо взвешенная, либо невзвешенная между собой центральность в зависимости от того, пройдена ли Карта веса.
Copyright (C) 2009 Попечители Университета Индианы.
Авторы: Ник Эдмондс и Эндрю Ламсдейн