Question: [ 1 0 marks ] 2 . Write a program that codes the greedy coloring algorithm. You should input a Graph and output a list
marks Write a program that codes the greedy coloring algorithm. You should input a Graph and output a list of colors, so that colorgraphi#the color of vertex i Once you have written your code, determine it's complexity see CISC or Ch of Rosen
You have a line limit of lines If you really all need more, let me know, but should be enough
You should consider a graph GV E is stored as a list of vertices V mathrmvmathrmvldotsmathrmvn and nlength list, and a list of tuples for the edges Ev i v jv i v j You do not need to define any classes or import any packages. Note that the edges are NOT directed so the edge from u to v may be stored as either mathrmumathrmv or mathrmvmathrmu
Note: it may be beneficial to create a list or dictionary of neighbors.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
