Question: Practical work 2 0 2 3 - 2 0 2 4 The practical work of the OR course consists of writing a Julia program using
Practical work
The practical work of the OR course consists of writing a Julia program using the JuMP library to solve an optimization problem. The problem and its variant is an application of the shortest path problem.
Problems definition and examples
Given a directed graph with cdots, the set of the vertices of the set of the arcs of and a positive distance associated with each arc of the problem consists in finding a shortest path from to if it exists The distance of the path is the sum of all the distances of the arcs of the path. This problem will be denoted in the following.
A variant of problem denoted will consist in finding two arcdisjoint paths such that the sum of their respective length is minimal. Both paths start from and end in Two paths are said to be arcdisjoint if they have no arc in common.
We consider the following weighted directed graph :
An optimal solution of problem in is given in green in the figure below. The optimal distance is
An optimal solution of problem in is given in red and blue in the graph below. The optimal value is
Questions
A graph will be represented by its adjacency matrix. You will have to compute the optimal value for problem and problem for different graph instances using JuliaJuMP and the free solver Cbc by following the steps below.
Define the variables associated with problem and write the Linear Program modeling
Define the variables associated with problem and write the Linear Program modeling
Write a Julia function named D that computes the optimal value of problem for a given adjacency matrix representing a graph and for two given vertices, a source and a destination.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
