Geophysical Inversion and Modelling Library  v1.3.1-2-g7599abf9
GIMLI::Dijkstra Class Reference

## Classes

class  ComparePairsClass_

class  DistancePair_

class  Edge_

## Public Member Functions

Dijkstra (const Graph &graph)

void setGraph (const Graph &graph)

void setStartNode (Index startNode)

void shortestPathTo (Index node, IndexArray &way) const

IndexArray shortestPathTo (Index node) const

IndexArray shortestPath (Index start, Index end)

double distance (Index root, Index node)

double distance (Index node)

RVector distances (Index root)

RVector distances () const

Graph & graph ()

const Graph & graph () const

GraphDistInfo graphInfo (Index na, Index nb)

## Protected Attributes

std::vector< Edge_pathMatrix_

NodeDistMap distances_

Graph graph_

Index _root

## Detailed Description

Dijkstra's shortest path finding

## ◆ distance() [1/2]

 double GIMLI::Dijkstra::distance ( Index node )

Distance to node to the last known root.

## ◆ distance() [2/2]

 double GIMLI::Dijkstra::distance ( Index root, Index node )

Distance from root to node.

## ◆ distances() [1/2]

 RVector GIMLI::Dijkstra::distances ( ) const

All distances from to last known root.

Referenced by distances().

## ◆ distances() [2/2]

 RVector GIMLI::Dijkstra::distances ( Index root )

All distances to root.

References distances().

## ◆ shortestPath()

 IndexArray GIMLI::Dijkstra::shortestPath ( Index start, Index end )

Get the shortest way from node index start to end.

References shortestPathTo().

## ◆ shortestPathTo() [1/2]

 IndexArray GIMLI::Dijkstra::shortestPathTo ( Index node ) const

Get the shortest way from root to node.

References shortestPathTo().

## ◆ shortestPathTo() [2/2]

 void GIMLI::Dijkstra::shortestPathTo ( Index node, IndexArray & way ) const

Get the shortest way from root to node. Inline version.

Referenced by shortestPath(), and shortestPathTo().