62#ifndef __ADS_Heuristics
63 #define __ADS_Heuristics
126std::pair< std::vector< std::pair< int , int > > ,
Nodes >
170 std::vector< T > * trace =
nullptr );
226 std::vector< int > side );
280 void inc(
int k ,
int u );
288 [[nodiscard]]
int count(
int k ,
int u )
const;
296 [[nodiscard]]
int dim(
int k ,
int h )
const;
301 [[nodiscard]]
int min(
int k )
const;
306 [[nodiscard]]
int max(
int k )
const;
316 void put(
int k ,
int u );
318 void take(
int k ,
int u );
322 [[nodiscard]]
bool consistent(
void )
const;
325 std::vector< Nodes > f_bucket[ 2 ];
326 std::vector< int > f_h[ 2 ] , f_place[ 2 ];
327 int f_min[ 2 ] , f_max[ 2 ];
379inline int overlap(
const std::string & a ,
const std::string & b );
429inline std::pair< int , std::vector< std::pair< std::string , std::string > > >
471#include "ADS/intractable/impl/Heuristics.tpp"
The alignments of two strings and of exercises 13.7 to 13.9 of the book: spaces are inserted in or...
The approximation algorithms of section 19.2 and of the exercises 19.6 and 19.8.
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The MFSET of section 10.2, the union of disjoint sets: MFSet( n ) makes the components ,...
The minimum spanning tree of an unoriented connected graph with weights on the edges (section 14....
The problems in NP of chapter 18, each with its polynomial certificate, which checks a proposed solut...
int min(int k) const
the least with bucket( k , h ) not empty, if none
bool contains(int u) const
whether is in the structure
Buckets(int n)
the empty structure for the nodes
const Nodes & bucket(int k, int h) const
the nodes with edges to
void remove(int u)
takes out of its two buckets, moving the least and the largest bucket not empty if they empty
int count(int k, int u) const
the edges of to
int max(int k) const
the largest with bucket( k , h ) not empty, if none
int dim(int k, int h) const
the number of the nodes with edges to
void inc(int k, int u)
has one more edge to , and moves to the next bucket
void insert(int u)
with no edges to either side, in the buckets 0
int choose(int k) const
the node to add to : in the least bucket of , the one with most edges to , the first of the bucket on...
int cutSize(const Adjacency &G, const std::vector< int > &side)
the number of the edges across the two sides
Nodes twoOptMove(Nodes pi, int i, int j)
the circuit of without the edges and , , not consecutive: the stretch reversed
std::vector< int > minMaxGreedy(const Adjacency &G, int a, int b)
the side of each node of , even, from in and in (the min-max-greedy of the book)
int overlap(const std::string &a, const std::string &b)
the length of the longest suffix of that is a prefix of , at most : the whole of if ends with it,...
std::vector< int > partitionLocalSearch(const std::vector< long > &A, std::vector< int > side)
the side, 0 or 1, of each element of , by the local search from side that moves an element or swaps t...
std::vector< int > dsatur(const Adjacency &G)
the coloring by saturation degree: the color, from 0, of each node of , colored one at a time with th...
long kOptNeighbors(int n, int k)
the size of on nodes: the circuits that share exactly edges with , by enumeration of all the circu...
Nodes twoOpt(const std::vector< std::vector< T > > &D, Nodes pi, std::vector< T > *trace=nullptr)
the local search on from , for the symmetric distances , taking the best circuit of the neighborhood...
long kOptNeighbours(int n, int k)
the former name of kOptNeighbors(), kept for the code that uses it
Definition Heuristics.h:195
std::pair< int, std::vector< std::pair< std::string, std::string > > > starAlignment(const std::vector< std::string > &P)
the star alignment: the center , the string with the largest sum of the global scores against the oth...
std::pair< std::vector< std::pair< int, int > >, Nodes > greedyTsp(const std::vector< std::vector< T > > &D)
the edges chosen, in the order of insertion, the last one closing the chain, and the circuit from 0,...
std::string greedySuperstring(const std::vector< std::string > &P)
a common superstring of , by the greedy on the overlaps: the oriented edges by decreasing overlap,...
std::vector< int > Nodes
a set, a path
Definition Problems.h:86
std::vector< std::vector< bool > > Adjacency
an adjacency
Definition Problems.h:83