Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
MinCliqueCoverSolverBase Class Referenceabstract

#include <drake/planning/graph_algorithms/min_clique_cover_solver_base.h>

Public Member Functions

virtual ~MinCliqueCoverSolverBase ()
std::vector< std::set< int > > SolveMinCliqueCover (const Eigen::SparseMatrix< bool > &adjacency_matrix, bool partition=false)
 Given the adjacency matrix of an undirected graph, finds a (potentially approximate) minimum clique cover of the graph.

Protected Member Functions

 MinCliqueCoverSolverBase ()=default
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 MinCliqueCoverSolverBase (const MinCliqueCoverSolverBase &)=default
MinCliqueCoverSolverBaseoperator= (const MinCliqueCoverSolverBase &)=default
 MinCliqueCoverSolverBase (MinCliqueCoverSolverBase &&)=default
MinCliqueCoverSolverBaseoperator= (MinCliqueCoverSolverBase &&)=default

Constructor & Destructor Documentation

◆ ~MinCliqueCoverSolverBase()

virtual ~MinCliqueCoverSolverBase ( )
virtual

◆ MinCliqueCoverSolverBase() [1/3]

MinCliqueCoverSolverBase ( const MinCliqueCoverSolverBase & )
protecteddefault

◆ MinCliqueCoverSolverBase() [2/3]

◆ MinCliqueCoverSolverBase() [3/3]

MinCliqueCoverSolverBase ( )
protecteddefault

Member Function Documentation

◆ operator=() [1/2]

MinCliqueCoverSolverBase & operator= ( const MinCliqueCoverSolverBase & )
protecteddefault

◆ operator=() [2/2]

MinCliqueCoverSolverBase & operator= ( MinCliqueCoverSolverBase && )
protecteddefault

◆ SolveMinCliqueCover()

std::vector< std::set< int > > SolveMinCliqueCover ( const Eigen::SparseMatrix< bool > & adjacency_matrix,
bool partition = false )
nodiscard

Given the adjacency matrix of an undirected graph, finds a (potentially approximate) minimum clique cover of the graph.

A clique is a collection of vertices in a graph such that each pair of vertices is connected by an edge (i.e. a fully connected subgraph). A clique cover is a collection of cliques where each vertex in the graph is in at least one of the cliques. This problem is known to be NP-complete, and so the concrete implementation of the solver determines whether the return of this function is the true minimum clique cover of the graph (which may take very long to compute), or only an approximate solution found via heuristics.

This method throws if the adjacency matrix is not symmetric and may throw depending on the concrete implementation of the solver.

Parameters
adjacency_matrixa symmetric binary matrix encoding the edge relationship.
partitionIf true, then every vertex is allowed to be covered exactly once. Otherwise, the same vertex may be covered multiple times.
Returns
A binary vector with the same indexing as the adjacency matrix, with true indicating membership in the clique.
The ith entry of the returned vector is a vector containing the indices of the ith clique.

Note that this method is intentionally not-const because some solvers may use randomized algorithms.


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