|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
138 : m_set(set), m_indices(subsetSize), m_numElements(subsetSize) {
140 for (
Index i = 0; i < m_numElements; i++) {
151 for (
Index i = 0; i < m_numElements; i++) {
152 if (m_indices[i] > (m_set.
size() - m_numElements + i)) {
166 for (
Index i = 0; i < m_numElements; i++) {
179 for (
Index i = m_numElements - 1; i >= 0; i--) {
181 if (m_indices[i] <= (m_set.
size() + i - m_numElements)) {
182 for (
int j = i + 1; j < m_numElements; j++) {
183 m_indices[j] = m_indices[i] + j - i;
204 virtual bool step(
int k) = 0;
215 template<
class CONTAINER>
218 for (
node v : nodes) {
221 for (
node v : nodes) {
222 for (
adjEntry adj : v->adjEntries) {
250 template<
class LISTITERATOR>
255 for (LISTITERATOR its = nodes; its.valid(); its++) {
262 if (!isInserted[twin]) {
264 isInserted[twin] =
true;
277 int getNeighborDegrees(
const node& v)
const;
289 template<
class LISTITERATOR>
293 complementNeighbors.
clear();
297 for (LISTITERATOR its = nodes; its.valid(); its++) {
301 isComplement[v] =
false;
306 getNeighbors<LISTITERATOR>(graph, nodes, neighbors);
307 for (
node& v : neighbors) {
308 isComplement[v] =
false;
313 if (isComplement[v]) {
328 template<
class LISTITERATOR>
334 for (
auto& iterator : iterators) {
335 for (LISTITERATOR its = iterator; its.valid(); its++) {
339 if (!isInserted[v]) {
341 isInserted[v] =
true;
354 virtual int getMaximumDegreeNode(
const Graph& graph,
node& maxDegreeNode)
const;
363 virtual int getMaximumDegreeNodes(
const Graph& graph,
List<node>& maxDegreeNodes)
const;
372 virtual int getMinimumDegreeNode(
const Graph& graph,
node& minDegreeNode)
const;
381 virtual int getMinimumDegreeNodes(
const Graph& graph,
List<node>& minDegreeNodes)
const;
399 virtual void reverseNodeTable(
const Graph& graphOrig,
const Graph& graphNew,
420 virtual void cliqueRemoval(
const Graph& graph,
List<node>& independentSet)
const;
430 int searchLinear(SearchWrapper* searchWrapper,
int start,
int end)
const;
440 int searchBinary(SearchWrapper* searchWrapper,
int start,
int end)
const;
448 int searchWigderson(SearchWrapper* searchWrapper)
const;
The namespace for all OGDF objects.
List< node > currentSubset()
Returns the current subset.
Includes declaration of graph class.
bool isOk()
Returns if the iterator, i.e.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
void getNeighbors(const Graph &graph, LISTITERATOR nodes, List< node > &neighbors) const
Calculates the set of neighbors Y for a given set of nodes X.
void makeSimpleUndirected(Graph &G)
Removes all self-loops and all but one edge of each bundle of undirected parallel edges.
Declaration and implementation of NodeSet, EdgeSet, and AdjEntrySet classes.
Class for adjacency list elements.
SubsetIterator(Array< node > &set, Index subsetSize)
Creates the SubsetIterator with a given set to iterate and the size of the subsets.
NodeColoringModule()
Default constructor.
const std::array< Color, 63 > colors
An array of 63 different colors to cycle through.
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
void mergeNodeLists(const Graph &graph, LISTITERATOR firstList, LISTITERATOR secondList, List< node > &mergedList) const
Merges two lists of nodes and deletes the duplicates.
Approximation algorithms for the node coloring problem in graphs.
Decralation of GraphElement and GraphList classes.
void insert(element_type v)
Inserts element v into this set.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
virtual void preprocessGraph(Graph &graph) const
Preprocesses a graph so that a coloring algorithm can be applied.
Doubly linked lists (maintaining the length of the list).
RegisteredArray for nodes, edges and adjEntries of a graph.
Data type for general directed graphs (adjacency list representation).
bool isMember(element_type v) const
Returns true iff element v is contained in this set.
virtual ~NodeColoringModule()
Destructor.
node twinNode() const
Returns the associated node of the corresponding adjacency entry (shorthand for twin()->theNode()).
void getNeighborsComplement(const Graph &graph, LISTITERATOR nodes, List< node > &complementNeighbors) const
Calculates the set of complement neighbors Y for a given set of nodes X.
Basic declarations, included by all source files.
HypergraphRegistry< HypernodeElement >::iterator end(const HypergraphRegistry< HypernodeElement > &self)
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Declaration and implementation of Array class and Array algorithms.
unsigned int NodeColor
Data type of the node colors.
Struct to iterate over all node subsets of a given size.
Declaration of doubly linked lists and iterators.
const Graph * graphOf() const
Returns the graph containing this node (debug only).
INDEX size() const
Returns the size (number of elements) of the array.
RamseyProcedure m_ramseyProcedure
The RamseyProcedure to be used to select nodes.
RamseyProcedure
Declares the procedure of finding nodes in Ramsey's algorithm.
bool checkIndependentSet(const Graph &graph, const CONTAINER &nodes) const
Checks if subgraph induced by the given nodes forms an independent set.
SearchProcedure
Declares the search procedures.
bool advance()
Advances the iterator so that the next subset can be queried.
Class for the representation of nodes.
Declaration of simple graph algorithms.
int Index
Data type for the indices.
iterator emplaceBack(Args &&... args)
Adds a new element at the end of the list.
void clear()
Removes all elements from the list.
Wraps the search for the minimum parameter k so that the same code can be reused for all algorithms.