ADS
Algorithms and Data Structures
Toggle main menu visibility
Loading...
Searching...
No Matches
AllPairsShortestPaths.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------*/
2
/*---------------------- File AllPairsShortestPaths.h ----------------------*/
3
/*--------------------------------------------------------------------------*/
50
/*--------------------------------------------------------------------------*/
51
/*----------------------------- DEFINITIONS --------------------------------*/
52
/*--------------------------------------------------------------------------*/
53
54
#ifndef __ADS_AllPairsShortestPaths
55
#define __ADS_AllPairsShortestPaths
56
/* self-identification: #endif constant */
57
58
/*--------------------------------------------------------------------------*/
59
/*------------------------------ INCLUDES ----------------------------------*/
60
/*--------------------------------------------------------------------------*/
61
62
#include "
ADS/Contract.h
"
63
#include "
ADS/graph/Graph.h
"
64
#include "
ADS/graph/ShortestPaths.h
"
65
66
#include <vector>
67
68
/*--------------------------------------------------------------------------*/
69
/*--------------------------- NAMESPACE ------------------------------------*/
70
/*--------------------------------------------------------------------------*/
71
72
namespace
ADS
73
{
74
76
template
<
class
D >
77
struct
AllPairs
78
{
79
std::vector< std::vector< D > >
d
;
80
std::vector< std::vector< int > >
p
;
81
bool
negativeCycle
=
false
;
82
};
83
108
template
< Graph G >
109
AllPairs< typename G::Weight >
floydWarshall
(
const
G & g );
110
135
template
<
class
D >
136
void
addEdge
(
AllPairs< D >
& R ,
int
a ,
int
b ,
const
D & w );
137
138
/*--------------------------------------------------------------------------*/
139
140
}
// end( namespace ADS )
141
142
/*--------------------------------------------------------------------------*/
143
/*-------------------------- IMPLEMENTATION --------------------------------*/
144
/*--------------------------------------------------------------------------*/
145
146
#include "ADS/graph/impl/AllPairsShortestPaths.tpp"
147
148
/*--------------------------------------------------------------------------*/
149
150
#endif
/* AllPairsShortestPaths.h included */
151
152
/*--------------------------------------------------------------------------*/
153
/*-------------------- End File AllPairsShortestPaths.h --------------------*/
154
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
ShortestPaths.h
The shortest paths of chapter 11 from a node of an oriented GRAPH whose edges have a cost [see Grap...
Graph.h
The GRAPH of chapter 9 and its realizations.
ADS::addEdge
void addEdge(AllPairs< D > &R, int a, int b, const D &w)
the insertion of the edge of cost ,
ADS::floydWarshall
AllPairs< typename G::Weight > floydWarshall(const G &g)
the shortest paths between all the pairs of nodes
ADS
Definition
ADT.h:96
ADS::AllPairs
the distances, the predecessors and whether there is a negative cycle
Definition
AllPairsShortestPaths.h:78
ADS::AllPairs::negativeCycle
bool negativeCycle
whether a negative cycle exists
Definition
AllPairsShortestPaths.h:81
ADS::AllPairs::d
std::vector< std::vector< D > > d
the distance of each pair
Definition
AllPairsShortestPaths.h:79
ADS::AllPairs::p
std::vector< std::vector< int > > p
the predecessor of each pair
Definition
AllPairsShortestPaths.h:80
ADS
graph
AllPairsShortestPaths.h
Generated by
1.17.0