1. It is, I also specifically asked "Conditional control", couldn't answer.

2. Yes, summation of (Ci / sizeof each packet).

The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

2. Yes, summation of (Ci / sizeof each packet).

Statement: Commuters check application to find the best route from point A to B. Since, everyone will use the road, it gets congested which leads to delay. Hence, find possible solution to solve this problem. (Hint: Modification of Dijkstra's algorithm )

Solution: There are well known solutions to find the shortest path from a source to destination (Dijkstra's algorithm). Everyone can find this and use this path. Since all are using this path, it gets congested so no longer it's the shortest path. Hence, we should look for the next best shortest path.

Hence, the algorithm can be called "Almost Shortest Path".

Using Dijkstra once, we can get the shortest path from A to B. Now we need to remove their edges one by one using the following relation:

Considering all the edges (u,v) having weight w in the shortest path:

If Dist. from A to B == (Dist. from A to u) + w (weight of the edge) + Distance from (B to v) then Remove the edge.

After this, Run Dijkstra again to get the next shortest path.

Solution: There are well known solutions to find the shortest path from a source to destination (Dijkstra's algorithm). Everyone can find this and use this path. Since all are using this path, it gets congested so no longer it's the shortest path. Hence, we should look for the next best shortest path.

Hence, the algorithm can be called "Almost Shortest Path".

Using Dijkstra once, we can get the shortest path from A to B. Now we need to remove their edges one by one using the following relation:

Considering all the edges (u,v) having weight w in the shortest path:

If Dist. from A to B == (Dist. from A to u) + w (weight of the edge) + Distance from (B to v) then Remove the edge.

After this, Run Dijkstra again to get the next shortest path.

- All categories
- Testimonials 48
- Numerical Ability 0
- Verbal Ability 1
- Engineering Mathematics 7
- Algorithms 2
- Databases 2
- Digital Logic 3
- CO & Architecture 2
- Computer Networks 3
- Compiler Design 2
- Programming & Data Structures 6
- Motivation 18
- Preparation Advice 53
- Theory of Computation 2
- Useful Links 10
- Study Materials 12
- Others 151
- Interview Experience 23
- Preparation Experience 29
- Announcements 53

34,786 questions

41,762 answers

118,950 comments

41,409 users

and is the answer of second question (Ci/size of each packet)??