As your instructor said it in class, there are many situations when you'll have to use your knowledge about graphs to solve real-life problems. The problem described here is one people in certain businesses (road-construction, communications, etc.) face all the time.
A letter to your instructor from the president of ACME-ExpertSnowPlowers is included. A complete description of the problem is included in a memo from your instructor.
For each business day you turn in your project earlier you receive a
5% bonus. However, penalties increase by 5% as well. You can turn in your
assignment up to ten business days ahead of the deadline.
You may be asked to do a code review with your instructor.
As you know, the weather forecast says that there is more snow for us in the weeks to come. This is fine with us and we really love snowy winters.
However we have a problem with a customer, a big company located in the western suburbs; they are very picky when it comes to having the snow removed from the roads that connect their buildings. Let me explain. They say that they need to have cleaned road connecting any two buildings as early as possible after the snowfall has ceased. My problem here is that I don't really know how to dispatch my plowers: to me it makes sense to have several plowers working at the same time until we meet our customer's demand, and then leave just one working until all roads are clean.
Can you help me with this? What roads should I clean first?
Thanks a lot and hope to see you soon,
P.S. What about a beer at your place (the BOG?) sometime next week?
Attachment: A map describing our's customer buildings and roads. Buildings are represented by the red bubbles and all distances are in yards.
|DATE:||February 5, 1997|
A business in Chicago has asked me to find a solution to their problem. I pass the problem on to you and I just add some details about input ond output formats. The problem can be modelled as a graph problem. What you have to do is to write a general program that takes a description of a connected graph from standard input, finds the shortest system of edges in the graph such that any two vertices are connected, and prints the result out to standard output.
Here is a description for the input and the output of your program.
The first line in the input indicates the number of vertices in the graph. Each graph has at least two vertices. The second line in the input indicates what vertex to begin with. Each additional line in the input will give the names of two vertices and the weight of the edge connecting them. For simplicity vertex names are positive integers. Weights are integers as well. Each edge may be listed only once and your program must verify it. Here is an example of input for a graph with three vertices:
1 2 35
2 3 46
The output will contain one line for each edge in the result. The output line contains the names of the vertices being connected, followed by the weight of the edge connecting them. The final line should be a sentence indicating the total weight. Here is an output line:
4 9 317
When you have your program running, solve the problem described by the president of ACME-ExpertSnowPlowers. You will assume that plowers start from the building b(your_SSN mod 10), where the function b is described by
(c) 1997, Virgil
Bistriceanu - firstname.lastname@example.org
Posted: February 7, 1997
Last update: February 7, 1997