QUBO++ Library with QUBO Solver APIs
Author: Koji Nakano, License: Non-commercial research and evaluation purposes without any guarantees.
Public Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
qbpp::graph_color::GraphColorQuadModel Class Reference

Class to store the QUBO expression with variables for the Graph Coloring Problem. More...

#include <qbpp_graph_color.hpp>

Inheritance diagram for qbpp::graph_color::GraphColorQuadModel:
Inheritance graph
[legend]
Collaboration diagram for qbpp::graph_color::GraphColorQuadModel:
Collaboration graph
[legend]

Public Member Functions

 GraphColorQuadModel (const GraphColorMap &map, uint32_t color_count)
 Generate a QUBO expression for the Graph Coloring Problem. More...
 
uint32_t node_count () const
 Returns the number of nodes in the TSP. More...
 
const qbpp::Vector< qbpp::Vector< qbpp::Var > > & get_x () const
 Returns the reference of the variables for the Graph Coloring Problem. More...
 
const std::vector< coeff_t > & get_linear () const
 
coeff_t get_linear (vindex_t index) const
 
const std::vector< vindex_t > & get_degree () const
 
vindex_t get_degree (vindex_t index) const
 
const std::vector< std::vector< std::pair< vindex_t, coeff_t > > > & get_quadratic () const
 
std::pair< vindex_t, coeff_tget_quadratic (vindex_t i, vindex_t j) const
 
size_t term_count (vindex_t deg) const
 
size_t term_count () const override
 
coeff_t get_min_coeff () const
 
coeff_t get_max_coeff () const
 
vindex_t var_count () const
 
Var get_var (vindex_t index) const
 
vindex_t get_index (Var var) const
 
bool has (Var var) const
 
const Exprget_expr () const
 
 operator const Expr & () const
 
energy_t get_constant () const
 
const Termsget_terms () const
 
std::vector< Varget_index_var () const
 

Static Protected Member Functions

static const Exprcheck_expr (const Expr &expr)
 
static Expr check_expr (Expr &&expr)
 

Protected Attributes

const std::shared_ptr< const Exprexpr_ptr_
 
const std::shared_ptr< const impl::IndexVarMapperindex_var_ptr_
 

Private Member Functions

std::pair< qbpp::Model, qbpp::Vector< qbpp::Vector< qbpp::Var > > > helper_func (const GraphColorMap &map, uint32_t color_count)
 Helper function to generate the QUBO expression for the GraphColorMap object and the number of colors. More...
 
 GraphColorQuadModel (std::pair< qbpp::QuadModel, qbpp::Vector< qbpp::Vector< qbpp::Var >>> pair)
 Delegated constructor for the GraphColorQuadModel. More...
 

Private Attributes

const qbpp::Vector< qbpp::Vector< qbpp::Var > > x_
 Variables for the Graph Coloring Problem. More...
 
const std::shared_ptr< const Implpimpl_
 
const std::vector< coeff_t > & linear_
 
const std::vector< vindex_t > & degree_
 
const std::vector< std::vector< std::pair< vindex_t, coeff_t > > > & quadratic_
 

Detailed Description

Class to store the QUBO expression with variables for the Graph Coloring Problem.

This class includes is a derived class of qbpp::QuadModel with the variables.

Definition at line 161 of file qbpp_graph_color.hpp.

Constructor & Destructor Documentation

◆ GraphColorQuadModel() [1/2]

qbpp::graph_color::GraphColorQuadModel::GraphColorQuadModel ( std::pair< qbpp::QuadModel, qbpp::Vector< qbpp::Vector< qbpp::Var >>>  pair)
inlineprivate

Delegated constructor for the GraphColorQuadModel.

Parameters
pairPair of the QUBO model and the variables

This constructor is used to create a GraphColorQuadModel object and variables.

Definition at line 174 of file qbpp_graph_color.hpp.

◆ GraphColorQuadModel() [2/2]

qbpp::graph_color::GraphColorQuadModel::GraphColorQuadModel ( const GraphColorMap map,
uint32_t  color_count 
)
inline

Generate a QUBO expression for the Graph Coloring Problem.

Parameters
mapMap of nodes with their coordinates
color_countNumber of colors to use for the coloring

Definition at line 182 of file qbpp_graph_color.hpp.

Member Function Documentation

◆ helper_func()

std::pair< qbpp::Model, qbpp::Vector< qbpp::Vector< qbpp::Var > > > qbpp::graph_color::GraphColorQuadModel::helper_func ( const GraphColorMap map,
uint32_t  color_count 
)
inlineprivate

Helper function to generate the QUBO expression for the GraphColorMap object and the number of colors.

Definition at line 357 of file qbpp_graph_color.hpp.

Here is the call graph for this function:

◆ node_count()

uint32_t qbpp::graph_color::GraphColorQuadModel::node_count ( ) const
inline

Returns the number of nodes in the TSP.

Returns
Number of nodes in the TSP.

Definition at line 187 of file qbpp_graph_color.hpp.

Here is the call graph for this function:

◆ get_x()

const qbpp::Vector<qbpp::Vector<qbpp::Var> >& qbpp::graph_color::GraphColorQuadModel::get_x ( ) const
inline

Returns the reference of the variables for the Graph Coloring Problem.

Definition at line 191 of file qbpp_graph_color.hpp.

Here is the caller graph for this function:

◆ get_linear() [1/2]

const std::vector<coeff_t>& qbpp::QuadModel::get_linear ( ) const
inlineinherited

Definition at line 1241 of file qbpp.hpp.

Here is the caller graph for this function:

◆ get_linear() [2/2]

coeff_t qbpp::QuadModel::get_linear ( vindex_t  index) const
inlineinherited

Definition at line 1250 of file qbpp.hpp.

◆ get_degree() [1/2]

const std::vector<vindex_t>& qbpp::QuadModel::get_degree ( ) const
inlineinherited

Definition at line 1243 of file qbpp.hpp.

Here is the caller graph for this function:

◆ get_degree() [2/2]

vindex_t qbpp::QuadModel::get_degree ( vindex_t  index) const
inlineinherited

Definition at line 1252 of file qbpp.hpp.

◆ get_quadratic() [1/2]

const std::vector<std::vector<std::pair<vindex_t, coeff_t> > >& qbpp::QuadModel::get_quadratic ( ) const
inlineinherited

Definition at line 1245 of file qbpp.hpp.

Here is the caller graph for this function:

◆ get_quadratic() [2/2]

std::pair<vindex_t, coeff_t> qbpp::QuadModel::get_quadratic ( vindex_t  i,
vindex_t  j 
) const
inlineinherited

Definition at line 1254 of file qbpp.hpp.

◆ term_count() [1/2]

size_t qbpp::QuadModel::term_count ( vindex_t  deg) const
inlineinherited

Definition at line 1258 of file qbpp.hpp.

Here is the caller graph for this function:

◆ term_count() [2/2]

size_t qbpp::QuadModel::term_count ( ) const
inlineoverridevirtualinherited

Reimplemented from qbpp::Model.

Definition at line 1268 of file qbpp.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_min_coeff()

coeff_t qbpp::QuadModel::get_min_coeff ( ) const
inlineinherited

Definition at line 1270 of file qbpp.hpp.

Here is the caller graph for this function:

◆ get_max_coeff()

coeff_t qbpp::QuadModel::get_max_coeff ( ) const
inlineinherited

Definition at line 1272 of file qbpp.hpp.

Here is the caller graph for this function:

◆ check_expr() [1/2]

static const Expr& qbpp::Model::check_expr ( const Expr expr)
inlinestaticprotectedinherited

Definition at line 1111 of file qbpp.hpp.

Here is the call graph for this function:

◆ check_expr() [2/2]

static Expr qbpp::Model::check_expr ( Expr &&  expr)
inlinestaticprotectedinherited

Definition at line 1120 of file qbpp.hpp.

Here is the call graph for this function:

◆ var_count()

vindex_t qbpp::Model::var_count ( ) const
inlineinherited

Definition at line 1154 of file qbpp.hpp.

Here is the caller graph for this function:

◆ get_var()

Var qbpp::Model::get_var ( vindex_t  index) const
inlineinherited

Definition at line 1156 of file qbpp.hpp.

Here is the caller graph for this function:

◆ get_index()

vindex_t qbpp::Model::get_index ( Var  var) const
inlineinherited

Definition at line 1158 of file qbpp.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ has()

bool qbpp::Model::has ( Var  var) const
inlineinherited

Definition at line 1160 of file qbpp.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_expr()

const Expr& qbpp::Model::get_expr ( ) const
inlineinherited

Definition at line 1164 of file qbpp.hpp.

Here is the caller graph for this function:

◆ operator const Expr &()

qbpp::Model::operator const Expr & ( ) const
inlineinherited

Definition at line 1166 of file qbpp.hpp.

◆ get_constant()

energy_t qbpp::Model::get_constant ( ) const
inlineinherited

Definition at line 1168 of file qbpp.hpp.

Here is the caller graph for this function:

◆ get_terms()

const Terms& qbpp::Model::get_terms ( ) const
inlineinherited

Definition at line 1170 of file qbpp.hpp.

◆ get_index_var()

std::vector<Var> qbpp::Model::get_index_var ( ) const
inlineinherited

Definition at line 1172 of file qbpp.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ x_

const qbpp::Vector<qbpp::Vector<qbpp::Var> > qbpp::graph_color::GraphColorQuadModel::x_
private

Variables for the Graph Coloring Problem.

Definition at line 163 of file qbpp_graph_color.hpp.

◆ pimpl_

const std::shared_ptr<const Impl> qbpp::QuadModel::pimpl_
privateinherited

Definition at line 1195 of file qbpp.hpp.

◆ linear_

const std::vector<coeff_t>& qbpp::QuadModel::linear_
privateinherited

Definition at line 1197 of file qbpp.hpp.

◆ degree_

const std::vector<vindex_t>& qbpp::QuadModel::degree_
privateinherited

Definition at line 1199 of file qbpp.hpp.

◆ quadratic_

const std::vector<std::vector<std::pair<vindex_t, coeff_t> > >& qbpp::QuadModel::quadratic_
privateinherited

Definition at line 1201 of file qbpp.hpp.

◆ expr_ptr_

const std::shared_ptr<const Expr> qbpp::Model::expr_ptr_
protectedinherited

Definition at line 1107 of file qbpp.hpp.

◆ index_var_ptr_

const std::shared_ptr<const impl::IndexVarMapper> qbpp::Model::index_var_ptr_
protectedinherited

Definition at line 1109 of file qbpp.hpp.


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