Scippy

SCIP

Solving Constraint Integer Programs

polyscip::WeightSpaceVertex Class Reference

Detailed Description

Class representing a vertex of the (partial) weight space polyhedron.

A vertex of the (partial) weight space polyhedron is given by a weight vector 'weight_' and an weighted objective value 'weighted_obj_val' and is active for a certain number of inequalities of the form 'weight_ \cdot y >= weighted_obj_val' where y are non-dominated extreme points of the considered problem

Definition at line 47 of file weight_space_vertex.h.

Class representing a vertex of the (partial) weight space polyhedron. More...

#include <weight_space_vertex.h>

Public Types

enum  VertexStatus {
  VertexStatus::marked,
  VertexStatus::obsolete,
  VertexStatus::unmarked,
  VertexStatus::special
}
 

Public Member Functions

 WeightSpaceVertex (WeightSpacePolyhedron::FacetContainer incident_facets, WeightType weight, ValueType weighted_obj_val, bool sort_facets=true)
 
 WeightSpaceVertex (double obs_coeff, double non_obs_coeff, const WeightSpaceVertex *obs, const WeightSpaceVertex *non_obs, const std::shared_ptr< const WeightSpaceFacet > &incident_facet, std::size_t wsp_dimension)
 
WeightType getWeight () const
 
ValueType getCurrentWOV () const
 
double getWeightedOutcome (const OutcomeType &outcome) const
 
double computeSlack (const OutcomeType &outcome, bool outcome_is_ray) const
 
bool hasUnitWeight () const
 
bool hasZeroWeight () const
 
VertexStatus getStatus () const
 
void setStatus (VertexStatus status)
 
bool hasSameWeight (const WeightType &weight) const
 
void print (std::ostream &os, bool printFacets=false) const
 

Friends

bool WeightSpacePolyhedron::areAdjacent (const WeightSpaceVertex *v, const WeightSpaceVertex *w)
 

Member Enumeration Documentation

◆ VertexStatus

Different statuses a weight space vertex can take

Enumerator
marked 
obsolete 
unmarked 
special 

Definition at line 53 of file weight_space_vertex.h.

Constructor & Destructor Documentation

◆ WeightSpaceVertex() [1/2]

polyscip::WeightSpaceVertex::WeightSpaceVertex ( WeightSpacePolyhedron::FacetContainer  incident_facets,
WeightType  weight,
ValueType  weighted_obj_val,
bool  sort_facets = true 
)
explicit

Default constructor

Parameters
incident_facetsIncident facets of the constructed vertex
weightLhs coefficients of the constructed vertex
weighted_obj_valRhs coefficient of the constructed vertex
sort_facetsif true, incident facets are sorted

Definition at line 52 of file weight_space_vertex.cpp.

◆ WeightSpaceVertex() [2/2]

polyscip::WeightSpaceVertex::WeightSpaceVertex ( double  obs_coeff,
double  non_obs_coeff,
const WeightSpaceVertex obs,
const WeightSpaceVertex non_obs,
const std::shared_ptr< const WeightSpaceFacet > &  incident_facet,
std::size_t  wsp_dimension 
)
explicit

Constructor creating a new vertex from an obsolete and non-obsolete vertex via the equality new_vertex = obs_coeff * obs + non_obs_coeff * non_obs

Parameters
obs_coeffCoefficient of obsolete vertex
non_obs_coeffCoefficient of non-obsolete vertex
obsObsolete vertex
non_obsNon-obsolete vertex
incident_facetIncident facet of new vertex
wsp_dimensionDimension of the corresponding weight space polyhedron

Definition at line 83 of file weight_space_vertex.cpp.

Member Function Documentation

◆ getWeight()

WeightType polyscip::WeightSpaceVertex::getWeight ( ) const

Returns associated weight vector of weight space vertex

Returns
Weight vector of vertex

Definition at line 122 of file weight_space_vertex.cpp.

Referenced by polyscip::WeightSpacePolyhedron::getUntestedWeight().

◆ getCurrentWOV()

ValueType polyscip::WeightSpaceVertex::getCurrentWOV ( ) const

Returns weighted objective value of vertex

Returns
weighted objective value

Definition at line 68 of file weight_space_vertex.cpp.

Referenced by computeSlack(), and polyscip::WeightSpacePolyhedron::getUntestedVertexWOV().

◆ getWeightedOutcome()

double polyscip::WeightSpaceVertex::getWeightedOutcome ( const OutcomeType outcome) const

Outcome vector \cdot weight vector

Parameters
outcomeOutcome vector
Returns
Scalarproduct of outcome and weight vector of vertex

Definition at line 131 of file weight_space_vertex.cpp.

Referenced by computeSlack().

◆ computeSlack()

double polyscip::WeightSpaceVertex::computeSlack ( const OutcomeType outcome,
bool  outcome_is_ray 
) const

Computes slack

Parameters
outcomeOutcome vector
outcome_is_rayIndicates whether given outcome corresponds to ray
Returns
outcome \cdot weight - weighted_obj_val if outcome corresponds to point; else outcome \cdot weight

Definition at line 146 of file weight_space_vertex.cpp.

References getCurrentWOV(), getWeightedOutcome(), and h.

Referenced by polyscip::WeightSpacePolyhedron::areAdjacent().

◆ hasUnitWeight()

bool polyscip::WeightSpaceVertex::hasUnitWeight ( ) const

Indicates whether weight vector of vertex corresponds to some unit vector

Returns
true if weight vector of vertex corresponds to some unit vector; otherwise false

Definition at line 184 of file weight_space_vertex.cpp.

References hasSameWeight().

◆ hasZeroWeight()

bool polyscip::WeightSpaceVertex::hasZeroWeight ( ) const

Indicates whether weight vector of vertex corresponds to zero vector

Returns
true if weight vector of vertex is zero vector; otherwise false

Definition at line 198 of file weight_space_vertex.cpp.

◆ getStatus()

VertexStatus polyscip::WeightSpaceVertex::getStatus ( ) const
inline

Get vertex status

Returns
Status of vertex

Definition at line 129 of file weight_space_vertex.h.

Referenced by polyscip::WeightSpacePolyhedron::getUntestedVertexWOV().

◆ setStatus()

void polyscip::WeightSpaceVertex::setStatus ( VertexStatus  status)
inline

◆ hasSameWeight()

bool polyscip::WeightSpaceVertex::hasSameWeight ( const WeightType weight) const

Compare weight vectors

Parameters
weightWeight to check against
Returns
true if given weight vector coincides with weight vector of vertex; otherwise false

Definition at line 176 of file weight_space_vertex.cpp.

Referenced by polyscip::WeightSpacePolyhedron::getUntestedVertexWOV(), hasUnitWeight(), polyscip::WeightSpacePolyhedron::incorporateKnownOutcome(), polyscip::WeightSpacePolyhedron::incorporateNewOutcome(), and setStatus().

◆ print()

void polyscip::WeightSpaceVertex::print ( std::ostream &  os,
bool  printFacets = false 
) const

Print function

Parameters
osOutput stream to write to
printFacetsIndicate whehter incident facets should be printed

Definition at line 211 of file weight_space_vertex.cpp.

References marked, obsolete, polyscip::global::print(), special, and unmarked.

Referenced by polyscip::WeightSpacePolyhedron::getUntestedVertexWOV(), and setStatus().

Friends And Related Function Documentation

◆ WeightSpacePolyhedron::areAdjacent

bool WeightSpacePolyhedron::areAdjacent ( const WeightSpaceVertex v,
const WeightSpaceVertex w 
)
friend
Parameters
v
w
Returns