digiKam
Digikam::Graph< VertexProperties, EdgeProperties >::Path Class Reference

Public Member Functions

bool isReachable (const Vertex &v) const
 
template<class GraphType >
void longestPath (const GraphType &graph, const Vertex &v)
 
template<class GraphType >
void shortestPath (const GraphType &graph, const Vertex &v)
 

Public Attributes

VertexIntMap distances
 
VertexVertexMap predecessors
 

Detailed Description

template<class VertexProperties, class EdgeProperties>
class Digikam::Graph< VertexProperties, EdgeProperties >::Path

Helper class to find paths through the graph. Call one of the methods and then read the maps.

Member Function Documentation

◆ isReachable()

template<class VertexProperties , class EdgeProperties >
bool Digikam::Graph< VertexProperties, EdgeProperties >::Path::isReachable ( const Vertex v) const
inline

◆ longestPath()

template<class VertexProperties , class EdgeProperties >
template<class GraphType >
void Digikam::Graph< VertexProperties, EdgeProperties >::Path::longestPath ( const GraphType &  graph,
const Vertex v 
)
inline

we provide a constant weight of 1

Invert the default compare method: With greater, we get the longest path

will be returned if a node is unreachable

Store distance and predecessors in QMaps, wrapped to serve as property maps

Referenced by Digikam::Graph< VertexProperties, EdgeProperties >::longestPathTouching().

◆ shortestPath()

template<class VertexProperties , class EdgeProperties >
template<class GraphType >
void Digikam::Graph< VertexProperties, EdgeProperties >::Path::shortestPath ( const GraphType &  graph,
const Vertex v 
)
inline

we provide a constant weight of 1

Store distance and predecessors in QMaps, wrapped to serve as property maps

Referenced by Digikam::Graph< VertexProperties, EdgeProperties >::shortestDistancesFrom(), and Digikam::Graph< VertexProperties, EdgeProperties >::shortestPath().

Member Data Documentation

◆ distances

template<class VertexProperties , class EdgeProperties >
VertexIntMap Digikam::Graph< VertexProperties, EdgeProperties >::Path::distances

◆ predecessors

template<class VertexProperties , class EdgeProperties >
VertexVertexMap Digikam::Graph< VertexProperties, EdgeProperties >::Path::predecessors

The documentation for this class was generated from the following file: