79#ifndef __ADS_BranchAndBound
80 #define __ADS_BranchAndBound
101#include <type_traits>
162T
oneTree(
const std::vector< std::vector< T > > & D ,
int r );
233std::pair< T , Nodes >
234bbTsp(
const std::vector< std::vector< T > > & D ,
const Nodes & start = {} ,
240template<
class T ,
class O >
241std::pair< T , Nodes >
bbTsp(
const std::vector< std::vector< T > > & D ,
243 long * generated , O & o );
291std::pair< T , Nodes >
littleTsp(
const std::vector< std::vector< T > > & D ,
292 long * generated =
nullptr );
326 const std::vector< long > & w ,
327 long * generated =
nullptr );
334 const std::vector< long > & w ,
335 long * generated , O & o );
365inline std::pair< long , Nodes >
knapsackBB(
const std::vector< long > & p ,
366 const std::vector< long > & v ,
368 long * generated =
nullptr );
374std::pair< long , Nodes >
knapsackBB(
const std::vector< long > & p ,
375 const std::vector< long > & v ,
long C ,
376 long * generated , O & o );
405inline std::pair< long , Nodes >
407 const std::vector< long > & v ,
long C ,
408 long * generated =
nullptr );
428inline std::pair< long ,
430 const std::vector< long > & v ,
441#include "ADS/intractable/impl/BranchAndBound.tpp"
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 PRIORITYQUEUE [see PriorityQueue.h] on a Fibonacci heap, the structure that section 11....
The minimum spanning tree of an unoriented connected graph with weights on the edges (section 14....
The typed modifications, beyond the book: the vocabulary by which a structure tells the observers att...
The primitives of the processor that the compilers spell each in their own way, in one form for all: ...
The problems in NP of chapter 18, each with its polynomial certificate, which checks a proposed solut...
The arithmetic of two words that C++20 does not spell, in one form for every compiler: the product of...
Changed< Value, H, V > Assigned
the value of an item changed
Definition Modification.h:623
mod::Assigned< int, T > IncumbentChanged
the best value found so far by a search changed, the handle 0
Definition BranchAndBound.h:118
std::pair< long, Nodes > knapsackGreedy(const std::vector< long > &p, const std::vector< long > &v, long C)
the greedy heuristic of KNAPSACK: the objects by decreasing profit per volume, each taken if it still...
std::pair< long, Nodes > knapsackBacktrack(const std::vector< long > &p, const std::vector< long > &v, long C, long *generated=nullptr)
KNAPSACK by backtracking with the simple bound: the objects in their order, each in and then out,...
T spanningTreeWeight(const std::vector< std::vector< T > > &D, const Nodes &V)
the weight of a minimum spanning tree of the nodes in , by the symmetric distances
std::pair< T, Nodes > bbTsp(const std::vector< std::vector< T > > &D, const Nodes &start={}, TspBound how=TspBound::BOOK, long *generated=nullptr)
the cost and a minimum circuit from 0, starting from the circuit start if not empty; the number of no...
std::pair< T, Nodes > littleTsp(const std::vector< std::vector< T > > &D, long *generated=nullptr)
the cost and a minimum circuit from 0, by the reduction of the matrix; the number of nodes of the tre...
TspBound
the lower bound of a circuit that starts with
Definition BranchAndBound.h:125
std::pair< long, Nodes > knapsackBB(const std::vector< long > &p, const std::vector< long > &v, long C, long *generated=nullptr)
the best profit and the objects of KNAPSACK by branch-&-bound, by places; the objects by decreasing p...
T tspLowerBound(const std::vector< std::vector< T > > &D, const Nodes &S, TspBound how=TspBound::BOOK)
a lower bound of the circuits that start with the path , the cost of the circuit if has all the cit...
T oneTree(const std::vector< std::vector< T > > &D, int r)
the weight of a minimum 1-tree of : a minimum spanning tree of the other nodes and the two least edge...
std::pair< long, Nodes > maxWeightClique(const Adjacency &G, const std::vector< long > &w, long *generated=nullptr)
the weight and the nodes of a clique of of largest weight (MAXIMUM WEIGHT CLIQUE),...
@ ONE_TREE
the bound of the 1-tree (exercise 19.10)
Definition BranchAndBound.h:127
@ BOOK
the bound of the text, by the least edges of each city
Definition BranchAndBound.h:126
std::vector< int > Nodes
a set, a path
Definition Problems.h:86
std::vector< std::vector< bool > > Adjacency
an adjacency
Definition Problems.h:83