Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

ogdf::HyperGraph Class Reference

#include <ogdf/basic/HyperGraph.h>

Classes

class  AdjArray
 Dynamic arrays indexed with adjacency entries. More...
 
class  AdjElement
 Representation of adjacency elements. More...
 
class  ArrayController
 Array controllers manage the graph arrays of an element. More...
 
class  ArrayControllerTypes
 
class  EdgeArray
 Dynamic arrays indexed with hyper edges. More...
 
class  EdgeElement
 Representation of hyper edges. More...
 
class  GraphArray
 
class  GraphArrayBase
 
class  NodeArray
 Dynamic arrays indexed with nodes. More...
 
class  NodeElement
 Representation of node elements. More...
 

Public Types

using edge = EdgeElement *
 
using node = NodeElement *
 

Public Member Functions

 HyperGraph ()
 Creates an empty hyper graph. More...
 
AdjElement * addNode (NodeElement *pNode, EdgeElement *pEdge, bool checkIfAlreadyExists=false)
 Makes pNode and pEdge incident; returns the corresponding HyperGraph::AdjElement. More...
 
void clear ()
 Clears the graph. More...
 
void delAdjElement (AdjElement *pAdj)
 Removes one endpoint pAdj from a hyper edge. More...
 
void delAdjElement (NodeElement *pNode, EdgeElement *pEdge)
 Removes the endpoint pNode from the hyper edge pEdge. More...
 
void delEdge (EdgeElement *pEdge)
 Deletes hyper edge pEdge. More...
 
void delNode (NodeElement *pNode)
 Deletes node pNode. More...
 
AdjElement * findAdjElement (NodeElement *pNode, EdgeElement *pEdge) const
 Returns the AdjElement for pNode and pEdge. More...
 
AdjElement * newAdjElement (NodeElement *pNode, EdgeElement *pEdge)
 Creates a new AdjElement which makes pNode and pEdge incident. More...
 
EdgeElement * newEdge ()
 Creates a new edge which is not incident to any nodes. More...
 
EdgeElement * newEdge (NodeElement *pNode1, NodeElement *pNode2)
 Creates a new edge which is incident to the two nodes pNode1, pNode2. More...
 
NodeElement * newNode ()
 Creates a new node. More...
 
int numberOfEdges () const
 
int numberOfNodes () const
 
void removeNode (NodeElement *pNode, EdgeElement *pEdge, bool removeDuplicates=false)
 If pNode and pEdge are incident, the corresponding AdjElement is removed. More...
 

Protected Member Functions

AdjElement * allocateAdjElement ()
 Allocates a new AdjElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized. More...
 
EdgeElement * allocateEdgeElement ()
 Allocates a new EdgeElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized. More...
 
NodeElement * allocateNodeElement ()
 Allocates a new NodeElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized. More...
 
void freeAdjElement (AdjElement *pAdj)
 Frees a used AdjElement. More...
 
void freeEdgeElement (EdgeElement *pEdge)
 Frees a used EdgeElement. More...
 
void freeNodeElement (NodeElement *pNode)
 Frees a used NodeElement. More...
 
void registerArray (GraphArrayBase< NodeElement > *pArray)
 
void registerArray (GraphArrayBase< EdgeElement > *pArray)
 
void registerArray (GraphArrayBase< AdjElement > *pArray)
 
void unregisterArray (GraphArrayBase< NodeElement > *pArray)
 
void unregisterArray (GraphArrayBase< EdgeElement > *pArray)
 
void unregisterArray (GraphArrayBase< AdjElement > *pArray)
 

Protected Attributes

EFreeListIndexPool< AdjElement, &AdjElement::m_pNext_nodeAdj, &AdjElement::m_index > m_adjAllocator
 
ArrayController< AdjElement > m_adjArrayController
 controller for adj arrays More...
 
EFreeListIndexPool< EdgeElement, &EdgeElement::m_pNext, &EdgeElement::m_index > m_edgeAllocator
 
ArrayController< EdgeElement > m_edgeArrayController
 controller for edge arrays More...
 
EFreeListIndexPool< NodeElement, &NodeElement::m_pNext, &NodeElement::m_index > m_nodeAllocator
 
ArrayController< NodeElement > m_nodeArrayController
 controller for node arrays More...
 
int m_numEdges
 
int m_numNodes
 
EdgeElement * m_pFirstEdge
 
NodeElement * m_pFirstNode
 
EdgeElement * m_pLastEdge
 
NodeElement * m_pLastNode
 

Friends

class HyperGraphTypes
 

Detailed Description

Definition at line 40 of file HyperGraph.h.

Member Typedef Documentation

◆ edge

Definition at line 131 of file HyperGraph.h.

◆ node

Definition at line 130 of file HyperGraph.h.

Constructor & Destructor Documentation

◆ HyperGraph()

ogdf::HyperGraph::HyperGraph ( )
inline

Creates an empty hyper graph.

Definition at line 651 of file HyperGraph.h.

Member Function Documentation

◆ addNode()

AdjElement* ogdf::HyperGraph::addNode ( NodeElement *  pNode,
EdgeElement *  pEdge,
bool  checkIfAlreadyExists = false 
)
inline

Makes pNode and pEdge incident; returns the corresponding HyperGraph::AdjElement.

Definition at line 431 of file HyperGraph.h.

◆ allocateAdjElement()

AdjElement* ogdf::HyperGraph::allocateAdjElement ( )
inlineprotected

Allocates a new AdjElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized.

Definition at line 337 of file HyperGraph.h.

◆ allocateEdgeElement()

EdgeElement* ogdf::HyperGraph::allocateEdgeElement ( )
inlineprotected

Allocates a new EdgeElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized.

Definition at line 329 of file HyperGraph.h.

◆ allocateNodeElement()

NodeElement* ogdf::HyperGraph::allocateNodeElement ( )
inlineprotected

Allocates a new NodeElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized.

Definition at line 321 of file HyperGraph.h.

◆ clear()

void ogdf::HyperGraph::clear ( )
inline

Clears the graph.

Definition at line 750 of file HyperGraph.h.

◆ delAdjElement() [1/2]

void ogdf::HyperGraph::delAdjElement ( HyperGraph::AdjElement *  pAdj)
inline

Removes one endpoint pAdj from a hyper edge.

Definition at line 688 of file HyperGraph.h.

◆ delAdjElement() [2/2]

void ogdf::HyperGraph::delAdjElement ( NodeElement *  pNode,
EdgeElement *  pEdge 
)
inline

Removes the endpoint pNode from the hyper edge pEdge.

Definition at line 424 of file HyperGraph.h.

◆ delEdge()

void ogdf::HyperGraph::delEdge ( HyperGraph::EdgeElement *  pEdge)
inline

Deletes hyper edge pEdge.

Definition at line 717 of file HyperGraph.h.

◆ delNode()

void ogdf::HyperGraph::delNode ( HyperGraph::NodeElement *  pNode)

Deletes node pNode.

Definition at line 731 of file HyperGraph.h.

◆ findAdjElement()

HyperGraph::AdjElement * ogdf::HyperGraph::findAdjElement ( HyperGraph::NodeElement *  pNode,
HyperGraph::EdgeElement *  pEdge 
) const
inline

Returns the AdjElement for pNode and pEdge.

In case pNode and pEdge are not incident the function returns 0.

Note
The function requires time O(min(degree(pNode), cardinality(pEdge))).
Parameters
pNodeis the node.
pEdgeis the hyper edge.

Definition at line 696 of file HyperGraph.h.

◆ freeAdjElement()

void ogdf::HyperGraph::freeAdjElement ( AdjElement *  pAdj)
inlineprotected

Frees a used AdjElement.

Definition at line 357 of file HyperGraph.h.

◆ freeEdgeElement()

void ogdf::HyperGraph::freeEdgeElement ( EdgeElement *  pEdge)
inlineprotected

Frees a used EdgeElement.

Definition at line 351 of file HyperGraph.h.

◆ freeNodeElement()

void ogdf::HyperGraph::freeNodeElement ( NodeElement *  pNode)
inlineprotected

Frees a used NodeElement.

Definition at line 345 of file HyperGraph.h.

◆ newAdjElement()

HyperGraph::AdjElement * ogdf::HyperGraph::newAdjElement ( HyperGraph::NodeElement *  pNode,
HyperGraph::EdgeElement *  pEdge 
)
inline

Creates a new AdjElement which makes pNode and pEdge incident.

Note
This function does not check if pNode and pEdge are already incident. Hypergraphs can deal with duplicate AdjElements. However, for reasons of clarity it is not a good idea to make use of it.
Parameters
pNodeis the node.
pEdgeis the hyper edge.

Definition at line 676 of file HyperGraph.h.

◆ newEdge() [1/2]

HyperGraph::EdgeElement * ogdf::HyperGraph::newEdge ( )
inline

Creates a new edge which is not incident to any nodes.

Definition at line 667 of file HyperGraph.h.

◆ newEdge() [2/2]

EdgeElement* ogdf::HyperGraph::newEdge ( NodeElement *  pNode1,
NodeElement *  pNode2 
)
inline

Creates a new edge which is incident to the two nodes pNode1, pNode2.

Definition at line 402 of file HyperGraph.h.

◆ newNode()

HyperGraph::NodeElement * ogdf::HyperGraph::newNode ( )
inline

Creates a new node.

Definition at line 658 of file HyperGraph.h.

◆ numberOfEdges()

int ogdf::HyperGraph::numberOfEdges ( ) const
inline

Definition at line 747 of file HyperGraph.h.

◆ numberOfNodes()

int ogdf::HyperGraph::numberOfNodes ( ) const
inline

Definition at line 745 of file HyperGraph.h.

◆ registerArray() [1/3]

void ogdf::HyperGraph::registerArray ( GraphArrayBase< NodeElement > *  pArray)
inlineprotected

Definition at line 311 of file HyperGraph.h.

◆ registerArray() [2/3]

void ogdf::HyperGraph::registerArray ( GraphArrayBase< EdgeElement > *  pArray)
inlineprotected

Definition at line 312 of file HyperGraph.h.

◆ registerArray() [3/3]

void ogdf::HyperGraph::registerArray ( GraphArrayBase< AdjElement > *  pArray)
inlineprotected

Definition at line 313 of file HyperGraph.h.

◆ removeNode()

void ogdf::HyperGraph::removeNode ( NodeElement *  pNode,
EdgeElement *  pEdge,
bool  removeDuplicates = false 
)
inline

If pNode and pEdge are incident, the corresponding AdjElement is removed.

Note
The function requires time O(min(degree(pNode), cardinality(pEdge))).
Parameters
pNodeis the node.
pEdgeis the hyper edge.
removeDuplicatesis a flag, if it is set the function will remove any existing duplicates too.

Definition at line 449 of file HyperGraph.h.

◆ unregisterArray() [1/3]

void ogdf::HyperGraph::unregisterArray ( GraphArrayBase< NodeElement > *  pArray)
inlineprotected

Definition at line 316 of file HyperGraph.h.

◆ unregisterArray() [2/3]

void ogdf::HyperGraph::unregisterArray ( GraphArrayBase< EdgeElement > *  pArray)
inlineprotected

Definition at line 317 of file HyperGraph.h.

◆ unregisterArray() [3/3]

void ogdf::HyperGraph::unregisterArray ( GraphArrayBase< AdjElement > *  pArray)
inlineprotected

Definition at line 318 of file HyperGraph.h.

Friends And Related Function Documentation

◆ HyperGraphTypes

friend class HyperGraphTypes
friend

Definition at line 42 of file HyperGraph.h.

Member Data Documentation

◆ m_adjAllocator

EFreeListIndexPool< AdjElement, &AdjElement::m_pNext_nodeAdj, &AdjElement::m_index > ogdf::HyperGraph::m_adjAllocator
protected

Definition at line 159 of file HyperGraph.h.

◆ m_adjArrayController

ArrayController<AdjElement> ogdf::HyperGraph::m_adjArrayController
protected

controller for adj arrays

Definition at line 309 of file HyperGraph.h.

◆ m_edgeAllocator

EFreeListIndexPool< EdgeElement, &EdgeElement::m_pNext, &EdgeElement::m_index > ogdf::HyperGraph::m_edgeAllocator
protected

Definition at line 153 of file HyperGraph.h.

◆ m_edgeArrayController

ArrayController<EdgeElement> ogdf::HyperGraph::m_edgeArrayController
protected

controller for edge arrays

Definition at line 308 of file HyperGraph.h.

◆ m_nodeAllocator

EFreeListIndexPool< NodeElement, &NodeElement::m_pNext, &NodeElement::m_index > ogdf::HyperGraph::m_nodeAllocator
protected

Definition at line 147 of file HyperGraph.h.

◆ m_nodeArrayController

ArrayController<NodeElement> ogdf::HyperGraph::m_nodeArrayController
protected

controller for node arrays

Definition at line 307 of file HyperGraph.h.

◆ m_numEdges

int ogdf::HyperGraph::m_numEdges
protected

Definition at line 140 of file HyperGraph.h.

◆ m_numNodes

int ogdf::HyperGraph::m_numNodes
protected

Definition at line 136 of file HyperGraph.h.

◆ m_pFirstEdge

EdgeElement* ogdf::HyperGraph::m_pFirstEdge
protected

Definition at line 138 of file HyperGraph.h.

◆ m_pFirstNode

NodeElement* ogdf::HyperGraph::m_pFirstNode
protected

Definition at line 134 of file HyperGraph.h.

◆ m_pLastEdge

EdgeElement* ogdf::HyperGraph::m_pLastEdge
protected

Definition at line 139 of file HyperGraph.h.

◆ m_pLastNode

NodeElement* ogdf::HyperGraph::m_pLastNode
protected

Definition at line 135 of file HyperGraph.h.


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