Fortgeschrittenenpraktikum
Classes | Public Member Functions | Private Attributes | List of all members
SegmentPricer Class Reference

Class representing pricing problem After each iteration of the master problem, the scip_redcost method is called. More...

#include <pricer.h>

Inheritance diagram for SegmentPricer:

Classes

class  PricerData
 Problem data class for the pricing problem. More...
 

Public Member Functions

 SegmentPricer (SCIP *scip, Graph &g_, std::vector< Graph::vertex_descriptor > master_nodes, std::vector< SCIP_CONS * > partitioning_cons, SCIP_CONS *num_segments_cons)
 Constructor for the pricer class. More...
 
 SCIP_DECL_PRICERINIT (scip_init)
 Set up pricer This replaces variables and constraints by their counterparts in the transformed problem.
 
SCIP_RETCODE setupVars (SCIP *scip_pricer, Graph::vertex_descriptor t)
 Add variables \(x_s\) for each superpixel \(s\in\mathcal{S}\) to the pricing problem represented by scip_pricer
 
virtual SCIP_DECL_PRICERREDCOST (scip_redcost)
 Reduced cost pricing method of variable pricer for feasible LPs Solves the pricing problem for each master node \(t\in T\). More...
 
std::pair< SCIP_Real, std::vector< Graph::vertex_descriptor > > heuristic (SCIP *scip, Graph::vertex_descriptor master_node, SCIP_Real lambda)
 
SCIP_RETCODE addPartitionVarFromPricerSCIP (SCIP *scip, SCIP *scip_pricer, SCIP_SOL *sol, Graph::vertex_descriptor t)
 Calls addPartitionVar with the vector of all superpixels \(s\) for which \(x_s = 1\).
 
SCIP_RETCODE addPartitionVar (SCIP *scip, Graph::vertex_descriptor master_node, std::vector< Graph::vertex_descriptor > superpixels)
 Adds a new segment variable to the master problem This also adds the variable to the appropriate existing constraints.
 

Private Attributes

Graph & g
 
std::vector< Graph::vertex_descriptor > master_nodes
 
std::vector< SCIP_CONS * > partitioning_cons
 
SCIP_CONS * num_segments_cons
 
std::vector< SCIP * > scip_pricers
 
int _bigM
 
int _n
 

Detailed Description

Class representing pricing problem After each iteration of the master problem, the scip_redcost method is called.

This method should generate a new column with negative reduced costs and add it to the problem.

Constructor & Destructor Documentation

SegmentPricer::SegmentPricer ( SCIP *  scip,
Graph &  g_,
std::vector< Graph::vertex_descriptor >  master_nodes,
std::vector< SCIP_CONS * >  partitioning_cons,
SCIP_CONS *  num_segments_cons 
)

Constructor for the pricer class.

Parameters
scipmaster SCIP instance
g_the graph of superpixels
master_nodesmaster nodes of all segments

Member Function Documentation

virtual SegmentPricer::SCIP_DECL_PRICERREDCOST ( scip_redcost  )
virtual

Reduced cost pricing method of variable pricer for feasible LPs Solves the pricing problem for each master node \(t\in T\).

If the reduced costs are negative, i.e.

\[-\sum_{s\in\mathcal{S}} x_s\cdot\mu_s + \sum_{s\in\mathcal{S}} x_s\cdot|y_t-y_s| < \lambda,\]

the generated segment consisting of all superpixels \(s\) for which \(x_s = 1\) is added to the master problem.

Todo:
add a heuristic

The documentation for this class was generated from the following files: