ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
FlowApplications.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*------------------------ File FlowApplications.h -------------------------*/
3/*--------------------------------------------------------------------------*/
58/*--------------------------------------------------------------------------*/
59/*----------------------------- DEFINITIONS --------------------------------*/
60/*--------------------------------------------------------------------------*/
61
62#ifndef __ADS_FlowApplications
63 #define __ADS_FlowApplications
64/* self-identification: #endif constant */
65
66/*--------------------------------------------------------------------------*/
67/*------------------------------ INCLUDES ----------------------------------*/
68/*--------------------------------------------------------------------------*/
69
70#include "ADS/Contract.h"
71#include "ADS/graph/Graph.h"
72#include "ADS/graph/MaxFlow.h"
73
74#include <algorithm>
75#include <cstddef>
76#include <limits>
77#include <map>
78#include <utility>
79#include <vector>
80
81/*--------------------------------------------------------------------------*/
82/*--------------------------- NAMESPACE ------------------------------------*/
83/*--------------------------------------------------------------------------*/
84
85namespace ADS
86{
87
94
95/*--------------------------------------------------------------------------*/
96/*------------------------------- FUNCTIONS --------------------------------*/
97/*--------------------------------------------------------------------------*/
98
128template< Graph G >
129std::vector< std::vector< int > >
130edgeDisjointPaths( const G & g , int s , int t ,
131 long long k = std::numeric_limits< long long >::max() );
132
163template< class T >
164CapacityDecrease decreaseCapacity( std::vector< std::vector< T > > & c ,
165 std::vector< std::vector< T > > & f ,
166 int s ,
167 int t , int u , int v );
168
169/*--------------------------------------------------------------------------*/
170
171} // end( namespace ADS )
172
173/*--------------------------------------------------------------------------*/
174/*-------------------------- IMPLEMENTATION --------------------------------*/
175/*--------------------------------------------------------------------------*/
176
177#include "ADS/graph/impl/FlowApplications.tpp"
178
179/*--------------------------------------------------------------------------*/
180
181#endif /* FlowApplications.h included */
182
183/*--------------------------------------------------------------------------*/
184/*---------------------- End File FlowApplications.h -----------------------*/
185/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The maximum flow of section 15.2 in a network , with integer capacities, and the minimum cut.
The GRAPH of chapter 9 and its realizations.
std::vector< std::vector< int > > edgeDisjointPaths(const G &g, int s, int t, long long k=std::numeric_limits< long long >::max())
at most paths from to with no edge in common, as many as there can be, each as its nodes from to
CapacityDecrease
what decreaseCapacity() did
Definition FlowApplications.h:89
CapacityDecrease decreaseCapacity(std::vector< std::vector< T > > &c, std::vector< std::vector< T > > &f, int s, int t, int u, int v)
decreases by 1, and the maximum flow from to within becomes a maximum flow within the new
@ CYCLE
one unit of a cycle of flow canceled, the value kept
Definition FlowApplications.h:91
@ PATH
one unit of a path canceled, then one augmenting path
Definition FlowApplications.h:92
@ SLACK
the edge was not saturated, nothing changed
Definition FlowApplications.h:90
Definition ADT.h:96