Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement a non - deterministic polynomial algorithm ( NOT greedy algorithm ) for solving the graph coloring problem. Your program should be able to read

Implement a non-deterministic polynomial algorithm (NOT greedy algorithm) for solving the graph coloring problem.
Your program should be able to read a graph description from a file and seek a random solution to
the corresponding decision problem.
The format of the file should be as follows:
1st line: number of vertices V and number of edges E in the graph, separated by a space.
2nd to (E+1) th line: pair of vertex IDs, describing the start and end vertex of an edge.
Vertex IDs start from 0.
The graph is considered to be undirected. For example, the values listed below describe the graph
shown on the right:
56
01
12
23
34
42
14
The maximum number of vertices is 100.
The input of your program should consist of:
The name of the graph description file.
The maximum number of colors to use
The maximum number of random solutions checked before answering "No".
Example:
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions