Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Your program should read input from a text file, and calculate the cost of the solution generated by your algorithm, that is , the cost
Your program should read input from a text file, and calculate the cost of the
solution generated by your algorithm, that is the cost of the edges in Your
program does not need to return the actual edges, just print out the total cost
rounded to two decimal places to standard output.
Your code will not be benchmarked or tested for time complexity, but for full
points it must be able to run instances similar to "Graphoo and each test will
time out after seconds. Your program will also be tested on hidden test cases.
Figure : Illustrating the graph described in Question with and
Showing an optimal solution having cost Consider the following variant of the Minimum Spanning Tree MST problem. We
are given an undirected graph with vertices numbered from o to
and edges, a positive not necessarily unique edge cost for each edge
in and a subset of edges AsubE note that A may contain cycles Suppose that
represents a set of possible direct fibre links between vertices and A represents the
existing set of direct fibre links between vertices. We would like to find the cheapest
way to connect all the vertices into one connected network.
The abstract problem we are interested in solving is to find a subset xsube
of edges of minimum cost such that is connected.
Task: Design an algorithm that solves this problem in time.
Implement your algorithm in Ed and test it on the following instances: Graph
Graph Graphooo. Each instance is given in a text file as described in Question
Each graph instance is given in a text file using the following format where is
the number of edges in :
For example, the following text describes the instance depicted in Fig. Note
that the vertices are numbered from o to
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