abLEMON 1.9.0-101-gccb8629
A maintained fork of LEMON
Loading...
Searching...
No Matches
Path Structures

Path structures implemented in LEMON. More...

Files

file  path.h

Classes

class  Path< GR >
 A structure for representing directed paths in a digraph. More...
class  SimplePath< GR >
 A structure for representing directed paths in a digraph. More...
class  ListPath< GR >
 A structure for representing directed paths in a digraph. More...
class  StaticPath< GR >
 A structure for representing directed paths in a digraph. More...
class  PathNodeIt< Path >
 Class for iterating through the nodes of a path. More...

Functions

template< typename From , typename To >
void pathCopy (const From &from, To &to)
 Make a copy of a path.
template< typename To , typename From >
void copyPath (To &to, const From &from)
 Deprecated version of pathCopy().
template< typename Digraph , typename Path >
bool checkPath (const Digraph &digraph, const Path &path)
 Check the consistency of a path.
template< typename Digraph , typename Path >
Digraph::Node pathSource (const Digraph &digraph, const Path &path)
 The source of a path.
template< typename Digraph , typename Path >
Digraph::Node pathTarget (const Digraph &digraph, const Path &path)
 The target of a path.
template< typename Path >
LemonRangeWrapper2< PathNodeIt< Path > , typename Path::Digraph , Path > pathNodes (const typename Path::Digraph &g, const Path &p)
 Gets the collection of the nodes of the path.

Detailed Description

This group contains the path structures implemented in LEMON.

LEMON provides flexible data structures to work with paths. All of them have similar interfaces and they can be copied easily with assignment operators and copy constructors. This makes it easy and efficient to have e.g. the Dijkstra algorithm to store its result in any kind of path structure.

See also
Path concept

Function Documentation

◆ pathCopy()

template< typename From , typename To >
void pathCopy ( const From & from,
To & to )

This function makes a copy of a path.

◆ copyPath()

template< typename To , typename From >
void copyPath ( To & to,
const From & from )

Deprecated version of pathCopy() (only for reverse compatibility).

◆ checkPath()

template< typename Digraph , typename Path >
bool checkPath ( const Digraph & digraph,
const Path & path )

This function checks that the target of each arc is the same as the source of the next one.

◆ pathSource()

template< typename Digraph , typename Path >
Digraph::Node pathSource ( const Digraph & digraph,
const Path & path )

This function returns the source node of the given path. If the path is empty, then it returns INVALID.

◆ pathTarget()

template< typename Digraph , typename Path >
Digraph::Node pathTarget ( const Digraph & digraph,
const Path & path )

This function returns the target node of the given path. If the path is empty, then it returns INVALID.

◆ pathNodes()

template< typename Path >
LemonRangeWrapper2< PathNodeIt< Path > , typename Path::Digraph , Path > pathNodes ( const typename Path::Digraph & g,
const Path & p )

This function can be used for iterating on the nodes of the path. It returns a wrapped PathNodeIt, which looks like an STL container (by having begin() and end()) which you can use in range-based for loops, STL algorithms, etc. For example you can write:

for( auto u : pathNodes( g , p ) )
doSomething( u );
LemonRangeWrapper2< PathNodeIt< Path > , typename Path::Digraph , Path > pathNodes( const typename Path::Digraph & g , const Path & p )
Gets the collection of the nodes of the path.
Definition path.h:1267