Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
7 views3 pages

BCS Project11 ReportTemplate

The project report outlines the work of Group BCS8 in implementing algorithms to identify special graph types to simplify the calculation of the chromatic number. The algorithms successfully recognize cycle graphs, bipartite graphs, complete graphs, tree graphs, and planar wheel graphs, leading to more efficient computations. The findings suggest that focusing on special graph types significantly reduces resource usage and improves the speed of chromatic number calculations.

Uploaded by

b.biancapopescu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

BCS Project11 ReportTemplate

The project report outlines the work of Group BCS8 in implementing algorithms to identify special graph types to simplify the calculation of the chromatic number. The algorithms successfully recognize cycle graphs, bipartite graphs, complete graphs, tree graphs, and planar wheel graphs, leading to more efficient computations. The findings suggest that focusing on special graph types significantly reduces resource usage and improves the speed of chromatic number calculations.

Uploaded by

b.biancapopescu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Project Report

Group BCS8

Members:
Olaf Bär i6393610
Ilia Gaevskii i6395346
Francois Garot i6395869
Leah Goldin i6405484
Edvard Høilund i6365044
Anna Kálmánczhelyi i6392588
Bianca Popescu i6378462

check names and id numbers

Methods and Motivations


Our goal in Phase 3 was to implement algorithms for identifying special graph types. This was thought to
be useful because then the calculation of the chromatic number would be simplified if the special graph
types were recognized.
We began the phase with researching different types of graphs. Our code already contained three
different methods to calculate the chromatic number. These were a brute force algorithm, a DSatur
algorithm, and a greedy algorithm. In this phase we focused on identifying special graph types and
calculating the chromatic number based on these.
The different types of graphs that our code can identify are cycle graph, bipartite graph, complete graph,
tree graph, and planar wheel graph.
We have created an Algorithm class in Phase 1 of the project and we added the code there for
identifying these specific types of graphs. The chromatic number is now calculated in a way where we
first search for special graph types. If the displayed graph is not of these graph types, then the algorithm
will move on to calculate the chromatic number using brute force algorithm with a limit of 3 seconds. If
this limit is exceeded, then the chromatic number will be calculated with the DSatur algorithm.

Cycle Graph
In a cycle graph, the vertices and edges of the graph are the same number. Additionally the graph must
consist of a single cycle, meaning that the number of vertices must be connected in a closed chain.
Chromatic number is equal to 2 when the vertices are even and 3 when they are odd. Therefore, the
algorithm looks for graphs that have the same number of edges and vertices, and then does a short
calculation to see if this number is odd or even. [1]

Bipartite
The purpose of the Depth-First Search algorithm (DFS) is to check whether a graph is bipartite or not.
A graph is bipartite if its chromatic number is 2. This means that we can color the graph using only 2
different colors, ensuring that no two connected vertices have the same color. A bipartite graph can be
used to split the vertices into 2 distinct groups. [2]
To achieve this, we start by selecting any vertex and assigning it a random color, such as 0 (or 1). When a
vertex is selected, we go through all its adjacent vertices, assigning them the opposite color (0 -> 1, 1 ->
0). This ensures that no two connected vertices have the same color.
Once all neighbors are colored, we use recursion to select a new vertex from the previously colored
vertices with uncolored neighbors and assign them the required color.
When the graph is fully colored, the algorithm will return true (bipartite) if there are no conflicts during
the process. Otherwise, the returned value will be false if any of these conditions are met:
While assigning a color to the adjacent vertices, one of them already has the same color as the current
vertex.
At the end of the process, a verification is executed to ensure the graph is correctly colored, revealing
that 2 connected vertices have the same color. [2]

Complete
One of the algorithms enhancing the computation of the chromatic number checks if the graph is
complete. We know that the number of edges in a complete graph with n vertices is (n*(n-1))/2,
therefore we can check if the actual number of edges matches this formula. If it does, we can
automatically say that the chromatic number is the number of vertices and make the computation
process much faster. [4]

Tree
A tree graph is an acyclic connected graph where the number of edges is exactly one less than the
number of vertices. Trees have exactly one path between any two vertices. In the algorithm we verify
that the number of edges matches the number of vertices minus one. [3] Depth-first Search algorithm is
used to check for cycles. Mark the current vertex as visited, then traverse all adjacent vertices of the
current vertex, if a visited adjacent vertex is not a parent, then a cycle has been detected, if adjacent
vertex is not visited, recursively check its neighbors. If any cycle is detected, the graph is not a tree.

Planar wheel
The planar wheel structure consists of a cycle and a hub, where all vertices in the cycle are connected to
a single center vertex. Determining if the graph is a planar wheel consists of two components. First, the
algorithm identifies a center vertex by finding a vertex that connects to all of the other vertices in the
graph. Then, it verifies that all of the remaining vertices form a cycle by checking that each of the non-
center vertices have exactly two neighbors. If both conditions are met, the graph is a planar wheel. The
chromatic number of a planar wheel depends on the number of vertices in the cycle, which is all vertices
except the center vertex. If the cycle has an even number of vertices, the graph needs 3 colors; if odd, it
needs 4 colors. [reference]

Experiments and Results


We tested these algorithms on many different graphs. We have checked specifically for these special
graph cases, and the algorithms correctly recognize these types. When they are recognized, the terminal
prints out the type of graph the chromatic number was calculated with and the chromatic number itself.
We also tested these algorithms on randomly generated graphs and graphs from user-uploaded files, so
not looking specifically for these graph types. The result was the same, the algorithms correctly
recognized these graph types and calculated the chromatic number accordingly.
Even if the number of vertices and edges is big, the algorithms work well at recognizing these special
graph types.
Findings and discussion
We found that our algorithms were efficient at identifying special graph types. After identifying the
graph types, the calculation of the chromatic number took less time.
That confirms that looking for special graph types to reduce computing resources while calculating the
chromatic number is useful. That is because the finding of the chromatic number gets restricted to a few
options of what that number could be.
In the future, it could be beneficial to implement algorithms for other graph types to further the
efficiency of chromatic number calculation.

References
[1] Bender, E. A., & Williamson, S. G. (2010). Lists, Decisions and Graphs. S. Gill Williamson.
https://books.google.nl/books?id=vaXv_yhefG8C&redir_esc=y
[2] GeeksforGeeks. (2013, April 22). Check whether a given graph is Bipartite or not. GeeksforGeeks.
https://www.geeksforgeeks.org/bipartite-graph/#using-depthfirst-search-dfs
[3] GeeksforGeeks. (2021, June 21). Introduction to Tree Data Structure. GeeksforGeeks.
https://www.geeksforgeeks.org/introduction-to-tree-data-structure
[4] Wikipedia Contributors. (2019, September 20). Complete graph. Wikipedia; Wikimedia Foundation.
https://en.wikipedia.org/wiki/Complete_graph

You might also like