Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve the 6 questiions using the graphs provided in the image. - - - - - - - - - - - - -

Please solve the 6 questiions using the graphs provided in the image.
----------------------------------------
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 G=(V,E) a directed graph with V={v1,cdots,vn} the set of the vertices of G,E the set of the arcs of G and a positive distance dij associated with each arc (i,j) of E, the problem consists in finding a shortest path from v1 to vn(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 P1 in the following.
A variant of problem P1, denoted P2 will consist in finding two arc-disjoint paths such that the sum of their respective length is minimal. Both paths start from v1 and end in vn. Two paths are said to be arc-disjoint if they have no arc in common.
We consider the following weighted directed graph G1 :
An optimal solution of problem P1 in G1 is given in green in the figure below. The optimal distance is 12.
An optimal solution of problem P2 in G1 is given in red and blue in the graph below. The optimal value is 29.
Questions
A graph will be represented by its adjacency matrix. You will have to compute the optimal value for
problem P1 and problem P2 for different graph instances using Julia/JuMP and the free solver Cbc by following the steps below.
1- Define the 0-1 variables associated with problem P1 and write the 0-1 Linear Program modeling P1.
2- Define the 0-1 variables associated with problem P2 and write the 0-1 Linear Program modeling P2.
3- Write a Julia function named D1 that computes the optimal value of problem P1 for a given adjacency matrix representing a graph G,and for two given vertices, a source and a destination.
4- Write a Julia function named D2 that computes the optimal value of problem P2 for a given adjacency matrix representing a graph G, and for two given vertices, a source and a destination.
5- Execute your functions on the adjacency matrix representing the graph G1 depicted in the previous section with the source v1 and the destination v16.
6- Generate different instances of directed graphs with different sizes and execute your functions on these instances to provide the optimal solutions. Provide the sources and destinations for each execution.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 1 Lnai 6321

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215879X, 978-3642158797

More Books

Students also viewed these Databases questions

Question

My opinions/suggestions are valued.

Answered: 1 week ago