ADS
Algorithms and Data Structures
Toggle main menu visibility
Loading...
Searching...
No Matches
BlossomMatching.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------*/
2
/*------------------------- File BlossomMatching.h -------------------------*/
3
/*--------------------------------------------------------------------------*/
79
/*--------------------------------------------------------------------------*/
80
/*----------------------------- DEFINITIONS --------------------------------*/
81
/*--------------------------------------------------------------------------*/
82
83
#ifndef __ADS_BlossomMatching
84
#define __ADS_BlossomMatching
85
/* self-identification: #endif constant */
86
87
/*--------------------------------------------------------------------------*/
88
/*------------------------------ INCLUDES ----------------------------------*/
89
/*--------------------------------------------------------------------------*/
90
91
#include "
ADS/Contract.h
"
92
#include "
ADS/graph/Graph.h
"
93
#include "
ADS/graph/Matching.h
"
94
#include "
ADS/graph/Visit.h
"
95
96
#include <algorithm>
97
#include <cstddef>
98
#include <tuple>
99
#include <type_traits>
100
#include <utility>
101
#include <vector>
102
103
// the solves from scratch on the matchings of LEMON with ADS_WITH_LEMON,
104
// unless ADS_MATCHING_LEMON is 0 (the benchmarks keep the code of ADS)
105
#if defined( ADS_WITH_LEMON ) && ! defined( ADS_MATCHING_LEMON )
106
#define ADS_MATCHING_LEMON 1
107
#endif
108
#if defined( ADS_MATCHING_LEMON ) && ADS_MATCHING_LEMON
109
#include <lemon/matching.h>
110
#include <lemon/smart_graph.h>
111
#endif
112
113
/*--------------------------------------------------------------------------*/
114
/*--------------------------- NAMESPACE ------------------------------------*/
115
/*--------------------------------------------------------------------------*/
116
117
namespace
ADS
118
{
119
120
/*--------------------------------------------------------------------------*/
121
/*------------------------------- FUNCTIONS --------------------------------*/
122
/*--------------------------------------------------------------------------*/
123
198
template
< Graph G >
199
std::vector< int >
maxCardinalityMatching
(
const
G & g );
200
254
template
<
class
W >
255
requires
std::is_arithmetic_v< W > && std::is_signed_v< W >
256
std::pair< W , std::vector< std::size_t > >
257
maxWeightMatching
(
int
n ,
258
const
std::vector< std::tuple< int , int , W > > & E ,
259
bool
maxCardinality =
false
);
260
261
/*--------------------------------------------------------------------------*/
262
263
}
// end( namespace ADS )
264
265
/*--------------------------------------------------------------------------*/
266
/*-------------------------- IMPLEMENTATION --------------------------------*/
267
/*--------------------------------------------------------------------------*/
268
269
#include "ADS/graph/impl/BlossomMatching.tpp"
270
271
/*--------------------------------------------------------------------------*/
272
273
#endif
/* BlossomMatching.h included */
274
275
/*--------------------------------------------------------------------------*/
276
/*----------------------- End File BlossomMatching.h -----------------------*/
277
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
Matching.h
Matchings, the sets of edges of a graph no two of which share an end beyond the capacities of the end...
Visit.h
The visits of a GRAPH of section 9.5 and their applications, each in time on lists or vectors of adj...
Graph.h
The GRAPH of chapter 9 and its realizations.
ADS::maxWeightMatching
std::pair< W, std::vector< std::size_t > > maxWeightMatching(int n, const std::vector< std::tuple< int, int, W > > &E, bool maxCardinality=false)
the largest total weight of a matching of the graph of nodes and of the edges , or,...
ADS::maxCardinalityMatching
std::vector< int > maxCardinalityMatching(const G &g)
the mate of each node in a matching of largest size of the unoriented graph , NIL for a node left unm...
ADS
Definition
ADT.h:96
ADS
graph
BlossomMatching.h
Generated by
1.17.0