Graph Maps

The same group on the Doxygen site.

group Graph Maps

Special graph-related maps.

This group contains maps that are specifically designed to assign values to the nodes and arcs/edges of graphs.

If you are looking for the standard graph maps (NodeMap, ArcMap, EdgeMap), see the Graph Structure Concepts.

Classes

Class

Description

IdMap

Provides an immutable and unique id for each item in a graph.

CrossRefMap

General cross reference graph map type.

RangeIdMap

Provides continuous and unique id for the items of a graph.

IterableBoolMap

Dynamic iterable bool map.

IterableIntMap

Dynamic iterable integer map.

IterableValueMap

Dynamic iterable map for comparable values.

SourceMap

Map of the source nodes of arcs in a digraph.

TargetMap

Map of the target nodes of arcs in a digraph.

ForwardMap

Map of the “forward” directed arc view of edges in a graph.

BackwardMap

Map of the “backward” directed arc view of edges in a graph.

InDegMap

Map of the in-degrees of nodes in a digraph.

OutDegMap

Map of the out-degrees of nodes in a digraph.

PotentialDifferenceMap

Potential difference map.

Functions and other members

template< typename GR , typename From , typename To >
void mapCopy(
const GR & gr,
const From & from,
To & to
)

Copy the values of a graph map to another map.

This function copies the values of a graph map to another graph map. To::Key must be equal or convertible to From::Key and From::Value must be equal or convertible to To::Value.

For example, an edge map of int value type can be copied to an arc map of double value type in an undirected graph, but an arc map cannot be copied to an edge map. Note that even a ConstMap can be copied to a standard graph map, but mapFill() can also be used for this purpose.

Parameters:
  • gr – The graph for which the maps are defined.

  • from – The map from which the values have to be copied. It must conform to the ReadMap concept.

  • to – The map to which the values have to be copied. It must conform to the WriteMap concept.

template< typename GR , typename Map1 , typename Map2 >
bool mapCompare(
const GR & gr,
const Map1 & map1,
const Map2 & map2
)

Compare two graph maps.

This function compares the values of two graph maps. It returns true if the maps assign the same value for all items in the graph. The Key type of the maps (Node, Arc or Edge) must be equal and their Value types must be comparable using operator==().

Parameters:
  • gr – The graph for which the maps are defined.

  • map1 – The first map.

  • map2 – The second map.

template< typename GR , typename Map >
Map::Key mapMin( const GR & gr , const Map & map )

Return an item having minimum value of a graph map.

This function returns an item (Node, Arc or Edge) having minimum value of the given graph map. If the item set is empty, it returns INVALID.

Parameters:
  • gr – The graph for which the map is defined.

  • map – The graph map.

template< typename GR , typename Map , typename Comp >
Map::Key mapMin(
const GR & gr,
const Map & map,
const Comp & comp
)

Return an item having minimum value of a graph map.

This function returns an item (Node, Arc or Edge) having minimum value of the given graph map. If the item set is empty, it returns INVALID.

Parameters:
  • gr – The graph for which the map is defined.

  • map – The graph map.

  • comp – Comparison function object.

template< typename GR , typename Map >
Map::Key mapMax( const GR & gr , const Map & map )

Return an item having maximum value of a graph map.

This function returns an item (Node, Arc or Edge) having maximum value of the given graph map. If the item set is empty, it returns INVALID.

Parameters:
  • gr – The graph for which the map is defined.

  • map – The graph map.

template< typename GR , typename Map , typename Comp >
Map::Key mapMax(
const GR & gr,
const Map & map,
const Comp & comp
)

Return an item having maximum value of a graph map.

This function returns an item (Node, Arc or Edge) having maximum value of the given graph map. If the item set is empty, it returns INVALID.

Parameters:
  • gr – The graph for which the map is defined.

  • map – The graph map.

  • comp – Comparison function object.

template< typename GR , typename Map >
Map::Value mapMinValue( const GR & gr , const Map & map )

Return the minimum value of a graph map.

This function returns the minimum value of the given graph map. The corresponding item set of the graph must not be empty.

Parameters:
  • gr – The graph for which the map is defined.

  • map – The graph map.

template< typename GR , typename Map , typename Comp >
Map::Value mapMinValue(
const GR & gr,
const Map & map,
const Comp & comp
)

Return the minimum value of a graph map.

This function returns the minimum value of the given graph map. The corresponding item set of the graph must not be empty.

Parameters:
  • gr – The graph for which the map is defined.

  • map – The graph map.

  • comp – Comparison function object.

template< typename GR , typename Map >
Map::Value mapMaxValue( const GR & gr , const Map & map )

Return the maximum value of a graph map.

This function returns the maximum value of the given graph map. The corresponding item set of the graph must not be empty.

Parameters:
  • gr – The graph for which the map is defined.

  • map – The graph map.

template< typename GR , typename Map , typename Comp >
Map::Value mapMaxValue(
const GR & gr,
const Map & map,
const Comp & comp
)

Return the maximum value of a graph map.

This function returns the maximum value of the given graph map. The corresponding item set of the graph must not be empty.

Parameters:
  • gr – The graph for which the map is defined.

  • map – The graph map.

  • comp – Comparison function object.

template< typename GR , typename Map >
Map::Key mapFind(
const GR & gr,
const Map & map,
const typename Map::Value & val
)

Return an item having a specified value in a graph map.

This function returns an item (Node, Arc or Edge) having the specified assigned value in the given graph map. If no such item exists, it returns INVALID.

Parameters:
  • gr – The graph for which the map is defined.

  • map – The graph map.

  • val – The value that have to be found.

template< typename GR , typename Map , typename Pred >
Map::Key mapFindIf(
const GR & gr,
const Map & map,
const Pred & pred
)

Return an item having value for which a certain predicate is true in a graph map.

This function returns an item (Node, Arc or Edge) having such assigned value for which the specified predicate is true in the given graph map. If no such item exists, it returns INVALID.

Parameters:
  • gr – The graph for which the map is defined.

  • map – The graph map.

  • pred – The predicate function object.

template< typename GR , typename Map >
int mapCount(
const GR & gr,
const Map & map,
const typename Map::Value & val
)

Return the number of items having a specified value in a graph map.

This function returns the number of items (Node, Arc or Edge) having the specified assigned value in the given graph map.

Parameters:
  • gr – The graph for which the map is defined.

  • map – The graph map.

  • val – The value that have to be counted.

template< typename GR , typename Map , typename Pred >
int mapCountIf(
const GR & gr,
const Map & map,
const Pred & pred
)

Return the number of items having values for which a certain predicate is true in a graph map.

This function returns the number of items (Node, Arc or Edge) having such assigned values for which the specified predicate is true in the given graph map.

Parameters:
  • gr – The graph for which the map is defined.

  • map – The graph map.

  • pred – The predicate function object.

template< typename GR , typename Map >
void mapFill(
const GR & gr,
Map & map,
const typename Map::Value & val
)

Fill a graph map with a certain value.

This function sets the specified value for all items (Node, Arc or Edge) in the given graph map.

Parameters:
  • gr – The graph for which the map is defined.

  • map – The graph map. It must conform to the WriteMap concept.

  • val – The value.