Graph 3
Graph 3
Many problems can be modeled using graphs with weights assigned to their edges.
As an illustration, consider how an airline system can be modeled. We set up the
basic graph model by representing cities by vertices and flights by edges. Problems
involving distances can be modeled by assigning distances between cities to the
edges. Problems involving flight time can be modeled by assigning flight times to
edges. Problems involving fares can be modeled by assigning fares to the edges.
Graphs that have a number assigned to each edge are called weighted graphs.
Several types of problems involving weighted graphs arise frequently. Determining a
path of least length between two vertices in a network is one such problem. For
instance, in the airline system represented by the weighted graph shown above, what
is a shortest path in air distance between Boston and Los Angeles? What
combinations of flights has the smallest total flight time (that is, total time in the air,
not including time between flights) between Boston and Los Angeles? What is the
cheapest fare between these two cities?
Example: Let's find the shortest paths between vertex 𝑎 and other vertices in the graph below
using Dijkstra's algorithm.
1.
2. Visited vertex
Adjacent vertices to and distances
Vertex is selected.
4. is visited vertex.
2
Vertex is selected.
3. Adjacent vertices to and distances
2.
2.
∞ ∞
0 ∞
∞
∞
∞
Los Angeles,
Denver,
Chicago,
New York,
99(CH) 129(NY)
89(DE)
∞
39(LA)
∞
LA visited
Denver,
New York,
39(LA)
∞
Denver visited
Chicago,
CH(99) NY(129)
89(DE)
39(LA)
𝐿(𝑆𝐹,𝐶𝐻)=99,𝐿(𝑆𝐹,𝑁𝑌)=129
Chicago visited
Boston,
New York,
Atlanta,
178(CH,BO)
99(CH) 129(NY)
89(DE)
198(CH,AT)
39(LA)
∞
𝐿(𝑆𝐹,𝑁𝑌)=129,
Boston,
Atlanta,
Miami,
168(NY,BO)
99(CH)
89(DE) 128(NY)
198(CH,AT)
39(LA)
228(NY,MI)
,
Atlanta visited
Miami,
City Path Fee
Los Angeles San Francisco-Los Angeles $39
Denver San Francisco-Denver $89
Chicago San Fransisco -Chicago $99
New York San Francisco- New York $129
Boston San Francisco-New York-Boston $168
Atlanta San Francisco-Chicago - Atlanta $198
Miami San Francisco – New York- Miami $228
What are the chromatic numbers of the graphs G and H?