ADS
Algorithms and Data Structures
Toggle main menu visibility
Loading...
Searching...
No Matches
EulerianCycle.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------*/
2
/*-------------------------- File EulerianCycle.h --------------------------*/
3
/*--------------------------------------------------------------------------*/
53
/*--------------------------------------------------------------------------*/
54
/*----------------------------- DEFINITIONS --------------------------------*/
55
/*--------------------------------------------------------------------------*/
56
57
#ifndef __ADS_EulerianCycle
58
#define __ADS_EulerianCycle
59
/* self-identification: #endif constant */
60
61
/*--------------------------------------------------------------------------*/
62
/*------------------------------ INCLUDES ----------------------------------*/
63
/*--------------------------------------------------------------------------*/
64
65
#include "
ADS/Contract.h
"
66
#include "
ADS/graph/Graph.h
"
67
68
#include <algorithm>
69
#include <cstddef>
70
#include <optional>
71
#include <utility>
72
#include <vector>
73
74
/*--------------------------------------------------------------------------*/
75
/*--------------------------- NAMESPACE ------------------------------------*/
76
/*--------------------------------------------------------------------------*/
77
78
namespace
ADS
79
{
80
104
template
< Graph G >
105
std::optional< std::vector< int > >
eulerianCycle
(
const
G & g );
106
139
template
< Graph G >
140
std::optional< std::vector< int > >
eulerianTrail
(
const
G & g );
141
160
template
< Graph G >
161
std::optional< std::vector< int > >
eulerianTrail
(
const
G & g ,
int
s );
162
175
template
< Graph G >
176
bool
isEulerianCycle
(
const
G & g ,
const
std::vector< int > & c );
177
196
template
< Graph G >
197
bool
isEulerianTrail
(
const
G & g ,
const
std::vector< int > & c );
198
199
/*--------------------------------------------------------------------------*/
200
201
}
// end( namespace ADS )
202
203
/*--------------------------------------------------------------------------*/
204
/*-------------------------- IMPLEMENTATION --------------------------------*/
205
/*--------------------------------------------------------------------------*/
206
207
#include "ADS/graph/impl/EulerianCycle.tpp"
208
209
/*--------------------------------------------------------------------------*/
210
211
#endif
/* EulerianCycle.h included */
212
213
/*--------------------------------------------------------------------------*/
214
/*------------------------ End File EulerianCycle.h ------------------------*/
215
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
Graph.h
The GRAPH of chapter 9 and its realizations.
ADS::isEulerianCycle
bool isEulerianCycle(const G &g, const std::vector< int > &c)
whether the nodes , the first repeated at the end, are a closed path that uses each edge of exactly ...
ADS::eulerianCycle
std::optional< std::vector< int > > eulerianCycle(const G &g)
the nodes of an Eulerian cycle of the graph, the first node repeated at the end, or nothing if there ...
ADS::eulerianTrail
std::optional< std::vector< int > > eulerianTrail(const G &g)
the nodes of an Eulerian trail of the graph, closed (the first node repeated at the end) if there is ...
ADS::isEulerianTrail
bool isEulerianTrail(const G &g, const std::vector< int > &c)
whether the nodes are a path, open or closed, that uses each edge of exactly once,...
ADS
Definition
ADT.h:96
ADS
graph
EulerianCycle.h
Generated by
1.17.0