Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the Fractional Knapsack Problem. 1 . ( 2 5 pts ) Design a greedy algorithm for Fractional Knapsack Problem that finds an optimum solution
Consider the Fractional Knapsack Problem.
pts Design a greedy algorithm for Fractional Knapsack Problem that finds an
optimum solution in On log n Report the pseudocode of your algorithm.
pts Implement your algorithm in Python. Randomly generate the inputs and
report the console outputs. Report your Python code scripts.
Question : pts Consider the Vertex Coloring Problem in which we assign different
colors to the adjacent vertices on a given graph G V E The objective is to color the
vertices of the graph using minimum number of colors.
Input: A graph G V E where V is the set of vertices and E is the set of edges of the
graph G
Output: Color assignments of the vertices using minimum number of colors.
Ex: For the graph G in Figure a vertex is a node in the graph and the set of vertices
is V v v v An edge is the line between two vertices and the set of edges is
E v vv vv vv vv vv v
The vertices v and v are adjacent since there is an edge v v between them. On the
other hand, v and v are not adjacent since there is no edge v v in the graph. Notice
that the adjacent vertices v and v have different colors red and green, respectively
whereas nonadjacent vertices v and v can have the same color red We observe that we
can color the vertices of the graph G in Figure with different colors, ie red, green, blue.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started