Scippy

GCG

Branch-and-Price & Column Generation for Everyone

gcg::GraphTclique Class Reference

Detailed Description

Definition at line 45 of file graph_tclique.h.

#include <graph_tclique.h>

Public Member Functions

 GraphTclique ()
 
virtual ~GraphTclique ()
 
virtual SCIP_RETCODE addNNodes (int _n_nodes)
 
virtual SCIP_RETCODE addNNodes (int _n_nodes, std::vector< int > weights)
 
virtual int getNNodes ()
 
virtual int getNEdges ()
 
virtual SCIP_RETCODE getEdges (std::vector< void * > &edges)
 
virtual SCIP_Bool isEdge (int i, int j)
 
virtual int getNNeighbors (int i)
 
virtual std::vector< int > getNeighbors (int i)
 
virtual SCIP_RETCODE addNode (int i, int weight)
 
virtual SCIP_RETCODE addNode ()
 
virtual SCIP_RETCODE deleteNode (int i)
 
virtual SCIP_RETCODE addEdge (int i, int j)
 
virtual SCIP_RETCODE addEdge (int i, int j, double weight)
 
virtual SCIP_RETCODE setEdge (int i, int j, double weight)
 
virtual double getEdgeWeight (int i, int j)
 
virtual std::vector< std::pair< int, double > > getNeighborWeights (int i)
 
virtual SCIP_RETCODE deleteEdge (int i, int j)
 
virtual int graphGetWeights (int i)
 
virtual SCIP_RETCODE flush ()
 
virtual SCIP_RETCODE normalize ()
 
virtual double getEdgeWeightPercentile (double q)
 
- Public Member Functions inherited from gcg::Bridge
 Bridge ()
 
virtual ~Bridge ()
 
virtual SCIP_RETCODE addNNodes (int _n_nodes)=0
 
virtual SCIP_RETCODE addNNodes (int _n_nodes, std::vector< int > weights)=0
 
virtual int getNNodes ()=0
 
virtual int getNEdges ()=0
 
virtual SCIP_RETCODE getEdges (std::vector< void * > &edges)=0
 
virtual SCIP_Bool isEdge (int i, int j)=0
 
virtual int getNNeighbors (int i)=0
 
virtual std::vector< int > getNeighbors (int i)=0
 
virtual SCIP_RETCODE addNode (int i, int weight)=0
 
virtual SCIP_RETCODE addNode ()=0
 
virtual SCIP_RETCODE addEdge (int i, int j, double weight)=0
 
virtual SCIP_RETCODE setEdge (int i, int j, double weight)=0
 
virtual double getEdgeWeight (int i, int j)=0
 
virtual std::vector< std::pair< int, double > > getNeighborWeights (int i)
 
virtual SCIP_RETCODE deleteNode (int i)=0
 
virtual SCIP_RETCODE addEdge (int i, int j)=0
 
virtual SCIP_RETCODE deleteEdge (int i, int j)=0
 
virtual int graphGetWeights (int i)=0
 
virtual SCIP_RETCODE flush ()=0
 
virtual SCIP_RETCODE normalize ()=0
 
virtual double getEdgeWeightPercentile (double q)=0
 

Constructor & Destructor Documentation

◆ GraphTclique()

gcg::GraphTclique::GraphTclique ( )

Definition at line 65 of file graph_tclique.cpp.

References TCLIQUE_CALL_EXC, and tcliqueCreate().

◆ ~GraphTclique()

gcg::GraphTclique::~GraphTclique ( )
virtual

Definition at line 81 of file graph_tclique.cpp.

References tcliqueFree().

Member Function Documentation

◆ addNNodes() [1/2]

SCIP_RETCODE gcg::GraphTclique::addNNodes ( int  _n_nodes)
virtual

add n nodes in the graph at the same time. it is much faster than to call addNode() many times

Implements gcg::Bridge.

Definition at line 70 of file graph_tclique.cpp.

References SCIP_INVALIDCALL.

◆ addNNodes() [2/2]

SCIP_RETCODE gcg::GraphTclique::addNNodes ( int  _n_nodes,
std::vector< int >  weights 
)
virtual

add n nodes in the graph at the same time. it is much faster than to call addNode() many times. weights represent node weights

Implements gcg::Bridge.

Definition at line 75 of file graph_tclique.cpp.

References SCIP_INVALIDCALL.

◆ getNNodes()

int gcg::GraphTclique::getNNodes ( )
virtual

get number of nodes in the graph

Implements gcg::Bridge.

Definition at line 86 of file graph_tclique.cpp.

Referenced by addEdge(), addNode(), and graphGetWeights().

◆ getNEdges()

int gcg::GraphTclique::getNEdges ( )
virtual

get number of edges in the graph

Implements gcg::Bridge.

Definition at line 91 of file graph_tclique.cpp.

References tcliqueGetNEdges().

◆ getEdges()

SCIP_RETCODE gcg::GraphTclique::getEdges ( std::vector< void * > &  edges)
virtual

get list of edges in the graph (not defined how edges are implemented)

Implements gcg::Bridge.

Definition at line 96 of file graph_tclique.cpp.

References SCIP_INVALIDCALL.

◆ isEdge()

SCIP_Bool gcg::GraphTclique::isEdge ( int  i,
int  j 
)
virtual

return whether a given pair of vertices is connected by an edge

Implements gcg::Bridge.

Definition at line 102 of file graph_tclique.cpp.

References SCIP_Bool.

◆ getNNeighbors()

int gcg::GraphTclique::getNNeighbors ( int  i)
virtual

get number of neighbors of a given node

Implements gcg::Bridge.

Definition at line 110 of file graph_tclique.cpp.

References tcliqueGetFirstAdjedge(), and tcliqueGetLastAdjedge().

◆ getNeighbors()

std::vector< int > gcg::GraphTclique::getNeighbors ( int  i)
virtual

get a vector of all neighbors of a given node

Implements gcg::Bridge.

Definition at line 116 of file graph_tclique.cpp.

References tcliqueGetFirstAdjedge(), and tcliqueGetLastAdjedge().

◆ addNode() [1/2]

SCIP_RETCODE gcg::GraphTclique::addNode ( int  i,
int  weight 
)
virtual

adds the node with the given weight to the graph

Implements gcg::Bridge.

Definition at line 123 of file graph_tclique.cpp.

References getNNodes(), SCIP_OKAY, TCLIQUE_CALL, and tcliqueAddNode().

◆ addNode() [2/2]

SCIP_RETCODE gcg::GraphTclique::addNode ( )
virtual

adds the node with 0 weight to the graph

Implements gcg::Bridge.

Definition at line 130 of file graph_tclique.cpp.

References SCIP_INVALIDCALL.

◆ deleteNode()

SCIP_RETCODE gcg::GraphTclique::deleteNode ( int  i)
virtual

deletes the given node from the graph

Implements gcg::Bridge.

Definition at line 135 of file graph_tclique.cpp.

References SCIP_ERROR.

◆ addEdge() [1/2]

SCIP_RETCODE gcg::GraphTclique::addEdge ( int  i,
int  j 
)
virtual

adds the edge to the graph

Implements gcg::Bridge.

Definition at line 140 of file graph_tclique.cpp.

References getNNodes(), SCIP_OKAY, TCLIQUE_CALL, and tcliqueAddEdge().

◆ addEdge() [2/2]

SCIP_RETCODE gcg::GraphTclique::addEdge ( int  i,
int  j,
double  weight 
)
virtual

adds the weighted edge to the graph

Implements gcg::Bridge.

Definition at line 152 of file graph_tclique.cpp.

References SCIP_INVALIDCALL.

◆ setEdge()

SCIP_RETCODE gcg::GraphTclique::setEdge ( int  i,
int  j,
double  weight 
)
virtual

sets the weight of the edge in the graph

Implements gcg::Bridge.

Definition at line 157 of file graph_tclique.cpp.

References SCIP_INVALIDCALL.

◆ getEdgeWeight()

double gcg::GraphTclique::getEdgeWeight ( int  i,
int  j 
)
virtual

returns the weight of the edge in the graph

Implements gcg::Bridge.

Definition at line 162 of file graph_tclique.cpp.

◆ getNeighborWeights()

std::vector< std::pair< int, double > > gcg::GraphTclique::getNeighborWeights ( int  i)
virtual

Reimplemented from gcg::Bridge.

Definition at line 167 of file graph_tclique.cpp.

◆ deleteEdge()

SCIP_RETCODE gcg::GraphTclique::deleteEdge ( int  i,
int  j 
)
virtual

deletes the edge from the graph

Implements gcg::Bridge.

Definition at line 172 of file graph_tclique.cpp.

References SCIP_ERROR.

◆ graphGetWeights()

int gcg::GraphTclique::graphGetWeights ( int  i)
virtual

return the weight of a node

Implements gcg::Bridge.

Definition at line 185 of file graph_tclique.cpp.

References getNNodes().

◆ flush()

SCIP_RETCODE gcg::GraphTclique::flush ( )
virtual

flushes the data stuctures, if needed

Implements gcg::Bridge.

Definition at line 178 of file graph_tclique.cpp.

References SCIP_OKAY, TCLIQUE_CALL, and tcliqueFlush().

◆ normalize()

SCIP_RETCODE gcg::GraphTclique::normalize ( )
virtual

normalizes the edge weights, so that the biggest edge egiht in the graph is 1

Implements gcg::Bridge.

Definition at line 194 of file graph_tclique.cpp.

References SCIP_INVALIDCALL.

◆ getEdgeWeightPercentile()

double gcg::GraphTclique::getEdgeWeightPercentile ( double  q)
virtual

Implements gcg::Bridge.

Definition at line 199 of file graph_tclique.cpp.