Adaptagrams
Public Member Functions | List of all members
dialect::NodeBuckets Struct Reference

#include <peeling.h>

Collaboration diagram for dialect::NodeBuckets:
Collaboration graph

Public Member Functions

 NodeBuckets (Graph &graph)
 Initialize a set of node buckets for the given Graph. More...
 
NodesById takeLeaves (void)
 Return a copy of the bucket of leaves, and clear the latter.
 
bool moveNode (id_type id, unsigned oldDegree, unsigned newDegree)
 Move a node from one bucket to another. More...
 
void severNodes (const NodesById &nodes)
 Sever the given Nodes from our Graph. More...
 

Detailed Description

For sorting all the nodes of a graph into "buckets" according to their degree. You can take all the leaves (degree-1 nodes) and you can move a node from one bucket to another.

Constructor & Destructor Documentation

◆ NodeBuckets()

NodeBuckets::NodeBuckets ( Graph graph)

Initialize a set of node buckets for the given Graph.

Creates buckets for all degrees up to the Graph's max degree, and populates these. Each bucket contains a NodesById map.

References dialect::Graph::getNodeLookup().

Here is the call graph for this function:

Member Function Documentation

◆ moveNode()

bool NodeBuckets::moveNode ( id_type  id,
unsigned  oldDegree,
unsigned  newDegree 
)

Move a node from one bucket to another.

Parameters
[in]idThe ID of the Node to be moved.
[in]oldDegreeThe bucket in which the Node should be found.
[in]newDegreeThe bucket to which the Node should be moved.
Returns
boolean saying whether the Node was found and moved.

Referenced by severNodes().

Here is the caller graph for this function:

◆ severNodes()

void NodeBuckets::severNodes ( const NodesById &  nodes)

Sever the given Nodes from our Graph.

Note
This method does modify the Graph. For each given Node, all incident Edges are severed, and the Node is removed from the Graph. The neighbouring Nodes are moved to new buckets as appropriate.
The given Nodes themselves are NOT moved to new buckets. This preserves the freedom to handle that operation separately.

References moveNode(), dialect::Graph::removeNodes(), and dialect::Graph::severNodeNotingNeighbours().

Referenced by dialect::peel().

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

The documentation for this struct was generated from the following files: