Question

Problem 5. (Lexicographical Optimisation with Paths) Provide pseudocode and an expla- nation for an algorithm that computes a

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here, we can use an approach similar to Djikstra's. But we have to apply a check for minimum "MAXIMUM WEIGHT" for the array.

function ModifiedDjikstra(Graph,sourceVertex):

for each vertex vert in Graph:

costOfGraph[vert] := -infinity ; //First we Define Unknown cost from every vertex to every //other vertex

previousOfVertex[vert] := undefined ; //And we define all previous vertex as undefined for every //vertex

end for

costOfGraph[sourceVertex] := infinity ; //This is cost from source to source

A := the set of each and every node in the Graph ;

while A is not Empty:-

b:= vertex in A with largest width in costOfGraph[]

remove b from A //as this has largest cost

if(costOfGraph[b] is -infinity) // This means we are still at initial state

break;

end if

for each neighbour c of b //c has not been removed from A

alternate := min(costOfGraph[c], max(costOfGraph[b], cost_between(b, c))) ; //we define //alternate as the cost with minimum maximum cost.It is minimum of cost of c and maximum of cost of b and between costs //of path

if(alternate<costOfGraph[c]) //Now we replace alternate if it is less than cost of c

costOfGraph[c]=alternate //we post cost of c as alternate as it is minimum

previousVertex[c]=b // and we set b as previous of c that gives us path

decrease-key in c in A // we then decrease key of c in array A(of all vertex)

end if

end for

end while

return width

end function

In Case of Any Queries, Please revert back

                  
 
Add a comment
Know the answer?
Add Answer to:
Problem 5. (Lexicographical Optimisation with Paths) Provide pseudocode and an expla- nation for an algorithm that comp...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Problem 6. (Weighted Graph Reduction) Your friend has written an algorithm which solves the all pairs shortest path pr...

    Problem 6. (Weighted Graph Reduction) Your friend has written an algorithm which solves the all pairs shortest path problem for unweighted undirected graphs. The cost of a path in this setting is the number of edges in the path. The algorithm UNWEIGHTEDAPSP takes the following input and output: UNWEİGHTEDA PSP Input: An unweighted undirected graph G Output: The costs of the shortest paths between each pair of vertices fu, v) For example, consider the following graph G. The output of...

  • Have the explaination please. 4 Graph Application: Network Connectivity (Adapted from Problem 9, Chapter 3 of...

    Have the explaination please. 4 Graph Application: Network Connectivity (Adapted from Problem 9, Chapter 3 of K&T) Think of a communications network as a connected, undi rected graph, where messages from one node s to another node t are sent along paths from s to t. Nodes can sometimes fail. If a node v fails then no messages can be sent along edges incident on v. A network is particularly vulnerable if failure of a single node v can cause...

  • Design and implement Dijkstra’s algorithm to compute all-pair shortest paths in any given graph using An...

    Design and implement Dijkstra’s algorithm to compute all-pair shortest paths in any given graph using An adjacency matrix using a one-dimensional array for storing only the elements of the lower triangle in the adjacency matrix.[Program in C language] The input to program must be connected, undirected, and weighted graphs. The programs must be able to find shortest paths on two types of connected, undirected, and weighted graphs: complete graph (a graph with a link between every pair of nodes) and...

  • Please help me with this answer. Performance Comparison for Dijkstra Algorithm and Bellman-Ford Algorithm Problem Description...

    Please help me with this answer. Performance Comparison for Dijkstra Algorithm and Bellman-Ford Algorithm Problem Description The shortest path problem is one of most important problems in graph theory and computer science in general. Shortest path problem is one of typical optimization problems. Given a graph G = (V,E), the goal is to nd a minimum cost path from s → t, s,t ∈ V . This variant is called one-to-one shortest path problem. Other variants are one-to-all (compute shortest...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT