Loading...
Searching...
No Matches
Graph Maps
Data Structures » Maps

## Detailed Description

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 | IdMap< GR, K >
| Provides an immutable and unique id for each item in a graph. More...
class | CrossRefMap< GR, K, V >
| General cross reference graph map type. More...
class | RangeIdMap< GR, K >
| Provides continuous and unique id for the items of a graph. More...
class | IterableBoolMap< GR, K >
| Dynamic iterable `bool` map. More...
class | IterableIntMap< GR, K >
| Dynamic iterable integer map. More...
class | IterableValueMap< GR, K, V >
| Dynamic iterable map for comparable values. More...
class | SourceMap< GR >
| Map of the source nodes of arcs in a digraph. More...
class | TargetMap< GR >
| Map of the target nodes of arcs in a digraph. More...
class | ForwardMap< GR >
| Map of the "forward" directed arc view of edges in a graph. More...
class | BackwardMap< GR >
| Map of the "backward" directed arc view of edges in a graph. More...
class | InDegMap< GR >
| Map of the in-degrees of nodes in a digraph. More...
class | OutDegMap< GR >
| Map of the out-degrees of nodes in a digraph. More...
class | PotentialDifferenceMap< GR, POT >
| Potential difference map. More...

## Functions

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.
template<typename GR, typename Map1, typename Map2>
bool | mapCompare (const GR &gr, const Map1 &map1, const Map2 &map2)
| Compare two graph maps.
template<typename GR, typename Map>
Map::Key | mapMin (const GR &gr, const Map &map)
| Return an item having minimum value of a 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.
template<typename GR, typename Map>
Map::Key | mapMax (const GR &gr, const Map &map)
| Return an item having maximum value of a 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.
template<typename GR, typename Map>
Map::Value | mapMinValue (const GR &gr, const Map &map)
| Return the minimum value of a 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.
template<typename GR, typename Map>
Map::Value | mapMaxValue (const GR &gr, const Map &map)
| Return the maximum value of a 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.
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.
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.
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.
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.
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.
template<typename K, typename GR>
IdMap< GR, K > | idMap (const GR &graph)
| Returns an `IdMap` class.
template<typename K, typename GR>
RangeIdMap< GR, K > | rangeIdMap (const GR &graph)
| Returns a `RangeIdMap` class.
template<typename GR>
SourceMap< GR > | sourceMap (const GR &graph)
| Returns a `SourceMap` class.
template<typename GR>
TargetMap< GR > | targetMap (const GR &graph)
| Returns a `TargetMap` class.
template<typename GR>
ForwardMap< GR > | forwardMap (const GR &graph)
| Returns a `ForwardMap` class.
template<typename GR>
BackwardMap< GR > | backwardMap (const GR &graph)
| Returns a `BackwardMap` class.
template<typename GR, typename POT>
PotentialDifferenceMap< GR, POT > | potentialDifferenceMap (const GR &gr, const POT &potential)
| Returns a PotentialDifferenceMap.

## Function Documentation

## mapCopy()

template<typename GR, typename From, typename To>

void mapCopy | ( | const GR & | gr,
|  | const From & | from,
|  | To & | to )

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.

## mapCompare()

template<typename GR, typename Map1, typename Map2>

bool mapCompare | ( | const GR & | gr,
|  | const Map1 & | map1,
|  | const Map2 & | map2 )

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.

## mapMin() [1/2]

template<typename GR, typename Map>

Map::Key mapMin | ( | const GR & | gr,
|  | const Map & | 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.

## mapMin() [2/2]

template<typename GR, typename Map, typename Comp>

Map::Key mapMin | ( | const GR & | gr,
|  | const Map & | map,
|  | const Comp & | comp )

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.

## mapMax() [1/2]

template<typename GR, typename Map>

Map::Key mapMax | ( | const GR & | gr,
|  | const Map & | 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.

## mapMax() [2/2]

template<typename GR, typename Map, typename Comp>

Map::Key mapMax | ( | const GR & | gr,
|  | const Map & | map,
|  | const Comp & | comp )

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.

## mapMinValue() [1/2]

template<typename GR, typename Map>

Map::Value mapMinValue | ( | const GR & | gr,
|  | const Map & | 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.

## mapMinValue() [2/2]

template<typename GR, typename Map, typename Comp>

Map::Value mapMinValue | ( | const GR & | gr,
|  | const Map & | map,
|  | const Comp & | comp )

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.

## mapMaxValue() [1/2]

template<typename GR, typename Map>

Map::Value mapMaxValue | ( | const GR & | gr,
|  | const Map & | 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.

## mapMaxValue() [2/2]

template<typename GR, typename Map, typename Comp>

Map::Value mapMaxValue | ( | const GR & | gr,
|  | const Map & | map,
|  | const Comp & | comp )

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.

## mapFind()

template<typename GR, typename Map>

Map::Key mapFind | ( | const GR & | gr,
|  | const Map & | map,
|  | const typename Map::Value & | val )

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.

## mapFindIf()

template<typename GR, typename Map, typename Pred>

Map::Key mapFindIf | ( | const GR & | gr,
|  | const Map & | map,
|  | const Pred & | pred )

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.

## mapCount()

template<typename GR, typename Map>

int mapCount | ( | const GR & | gr,
|  | const Map & | map,
|  | const typename Map::Value & | val )

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.

## mapCountIf()

template<typename GR, typename Map, typename Pred>

int mapCountIf | ( | const GR & | gr,
|  | const Map & | map,
|  | const Pred & | pred )

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.

## mapFill()

template<typename GR, typename Map>

void mapFill | ( | const GR & | gr,
|  | Map & | map,
|  | const typename Map::Value & | val )

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.

## idMap()

template<typename K, typename GR>

IdMap< GR, K > idMap | ( | const GR & | graph | ) |

related

This function just returns an `IdMap` class.

## rangeIdMap()

template<typename K, typename GR>

RangeIdMap< GR, K > rangeIdMap | ( | const GR & | graph | ) |

related

This function just returns an `RangeIdMap` class.

## sourceMap()

template<typename GR>

SourceMap< GR > sourceMap | ( | const GR & | graph | ) |

related

This function just returns an `SourceMap` class.

## targetMap()

template<typename GR>

TargetMap< GR > targetMap | ( | const GR & | graph | ) |

related

This function just returns a `TargetMap` class.

## forwardMap()

template<typename GR>

ForwardMap< GR > forwardMap | ( | const GR & | graph | ) |

related

This function just returns an `ForwardMap` class.

## backwardMap()

template<typename GR>

BackwardMap< GR > backwardMap | ( | const GR & | graph | ) |

related

This function just returns a `BackwardMap` class.

## potentialDifferenceMap()

template<typename GR, typename POT>

PotentialDifferenceMap< GR, POT > potentialDifferenceMap | ( | const GR & | gr,
|  | const POT & | potential )

related

This function just returns a PotentialDifferenceMap.