Você está na página 1de 1

Lower Bound calculating method

lowerBound global var preset to 0


getLB(Graph, number of nodes)
Create adjacency matrix
Find all neighbours of all nodes, store them in a jagged array
Create array of degrees
Heapsort array of degrees
Loop: for all nodes, in descending order of degrees, that have more neighbours than the current
lower bound:
Call the recursiveSearh(Graph, adjacency matrix, node’s neighbours, lowerBound)
Compare return value to previous lowerBound.
If return value greater, overwrite lowerBound
Return lowerBound
------------------------------------------------------------------------------------------------------------------------------------------
recurisveSearch(Graph, adjacency matrix, node’s neighbours, lowerBound)
If the call has more neighbours than the lowerbound
Create adjacency matrix of neighbours
Count connections in the matrix, save into sum variable
If sum = max value of neighbours adjacency return the number of neighbours as lowerBound
Else if sum + 2 = max value of neighbours adjacency return the number of neighbours as
lowerBound (pruning step)
Else if sum = 0 it’s an isolated node, return previous lowerBound (pruning step)
Else
Create smaller array for new set of neighbours
Find the node with the least edges
Remove the node (only 1 at a time)
Recall recursiveSearch(Graph, adjacency matrix, new neighbours, lowerBound)
Else return previous lowerBound (pruning step)

Lower bound based on:


http://www.personal.kent.edu/~rmuhamma/GraphTheory/MyGraphTheory/coloring.htm
Heapsort based on Jason Harrisons algorithm’s modified version provided for CCN (2018-200-KEN1210)

Você também pode gostar