0% found this document useful (0 votes)
6 views

IElab 09

Lab description

Uploaded by

Aaron Stefun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

IElab 09

Lab description

Uploaded by

Aaron Stefun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Lab 09: Modeling for Decision Making

By: Prof. N. Hemachandra Date 16-Oct-2024

Objective: In this lab, students will try to propose a solution to an open-ended problem based on their
respective understanding of the given scenario.

Instructions: Below are some instructions. Please go through them carefully:


• Given below is a scenario where students need to propose a solution-based
• Use the traditional approach to name your files for submission:
– ROLLNUMBER IE507 Lab09.ipynb;
– ROLLNUMBER IE507 Lab09 Report.pdf

Question 1: Efficient Tour Planning- A Heuristic Approach


Consider that S1 and S2 are two cities miles apart as hometown and workplace (are known as source nodes,
S). A list of cities of attractions for your itinerary is given as a set C (representing the cities you plan to
visit along with your parents). Further, these cities of attractions are distributed over a geographical region,
and direct connectivity may/may not be possible from one tourist attraction to the other. Both S1 and
S2 belong to metropolitan regions, and a direct route is possible from S to C. But you are constrained by
choice to select a meeting point from a set M, which intersects on S1 − S2 route. All cities in C are well
spread and may be connected from M via. some distance and trains respectively. Below is a graph in Fig. 1
for the network connecting various cities in M and C. Note that a dashed-blue vertex is between the edges
of elements of C with a meeting point in M. A black vertex represents the route link between a meeting
point in set M and a source city from S. Below is a sample layout for a graph with two source nodes, one
meeting points, and one city of attractions. Further, we provide you with some datasets to describe the
characteristics of the below network.


Data Set ∀i, j ∈ S ∪ C ∪ M
• S = {S1, S2} represents source nodes
• C = {C1, C2, · · · Cp} represents nodes for cities of attraction where p = 1
• M = {M1, M2, · · · Mq} represents nodes for possible meeting points where q = 1
• N = n ij denotes the adjacency matrix representing the possible route between node i to node j.
 

S1 S2 M1 C1
S1 0 0 1 0
S2 0 0 1 0
M1 1 1 0 1
C1 0 0 1 0

• D = d ij denotes the distance matrix representing the distance (in kms) between node i to node j.
 

S1 S2 M1 C1
S1 0 0 1508 0
S2 0 0 807 0
M1 1508 807 0 167
C1 0 0 167 0
Figure 1: A layout for network with two source cities (S1, S2), one meeting point M1 and one city of
attraction C1

Page 2
• F = f ij denotes the frequency matrix representing the daily frequency of trains between node i to
 

S1 S2 M1 C1
S1 0 0 8 0
node j. S2 0 0 5 0
M1 8 5 0 6
C1 0 0 6 0

• TT = ttk ij denotes the travel time matrix representing the travel time for k th train between node i
 

to node j where k ∈ Fij . Note that travel time is symmetric that is travel time for node j to node i is
same as node i to node j.
S1 to M1: [18:35, 21:27, 19:46, 26:25, 28:36, 20:28, 32:16, 22:10]
S2 to M1: [16:25, 19:38, 20:56, 09:13, 12:08]
M1 to C1: [03:42, 02:56, 04:15, 03:18, 05:08, 03:50]

• DEP = depk ij denotes the departure time matrix representing the departure time for k th train be-
 

tween node i to node j where k ∈ Fij .


S1 to M1: [16:30, 14:40, 03:55, 01:25, 10:26, 12:25, 06:35, 20:15]
M1 to S1: [18:25, 06:20, 02:25, 05:15, 09:20, 15:15, 20:18, 22:20]

S2 to M1: [04:20, 08:35, 12:15, 18:12, 22:18]


M1 to S2: [12:25, 15:16, 18:21, 07:25, 21:20]

M1 to C1: [05:50, 10:25, 12:30, 18:15, 21:05, 16:20]


C1 to M1: [04:00, 07:15, 10:55, 18:35, 21:25, 23:50]

• ARR = arrk ij denotes the arrival time matrix representing the arrival time for k th train between
 

node i to node j where k ∈ Fij .


NOTE: Model the scenario below using your programming skills so that your proposed solution works for
large networks. For simplicity, assume that there is zero stoppage time at each node. Also, all the train
timetable is in a 24-hour format.

Scenario A: Creating DataFrames


1. You are given above the travel and departure times for each type of train on each network link. Identify
the Arrival Time for the above trains. Also, create a dataframe (or a suitable numpy array) using the
above data for Arrival and Departure with the row as From-station and the column as To-station.
2. Execute a code to create an Arrival-Departure Board for all the nodes based on the above-given data
set.
Note 1 : While creating dataframe for Arrival-Departure Board each train must be named for identi-
fication. For more details, refer to the footnote given below.
1

< DepartureT ime(at Origin Node) > < OriginN ode >< DestinationN ode > < ArrivalT ime(at Dest. Node) >

A sample entry on board might look like


S1 −→ M1(05:30 S1C1 05:15): Departing S1 @ 05:30 and reaching M1@01 : 30 (+1 day).

Page 3
Scenario B: Scheduling Intersection
Note 2 : While providing an output of a feasible itinerary, you need to use an approach similar to the
elementary set theory; for more details, refer to the footnote below.
1. A layover in our context significantly differs from the waiting time at the meeting point. Layover is
when both parties come separately and wait for the next leg of the journey. At the same time, waiting
time here refers to either of the parties reaching early at the meeting point and waiting for the other
party.
• Create a plot for feasible trains arriving at the meeting point M1 arriving from {S1, S2} against
the possible number of feasible departures for C1 with a minimum layover time of 1 hour. You
should look for a feasible train from M1 to C1, whose departure from M1 is up to 24 hours from
the time of first arrival at M1 (this is same as saying that waiting time+layover time is less than
24 hours).
• Also, report your feasible travel plan using the prescribed notation.
2. Repeat the same if the minimum layover time belongs to the set {2, 5} hours. Describe your obtained
plot based on your understanding.
3. Assume that your tour planning is now constrained by waiting time at meeting point M1 say, waiting
time not more 1.5 hours. You can continue to assume a minimum layover time of 2 hours. Plot
your feasible set of trains from the source nodes {S1, S2} against departing trains at M1 to C1 with
required layovers and waiting time. Describe your obtained plot based on your understanding. Also,
report your feasible travel plan using the prescribed notation.
4. Repeat part 3 with a maximum waiting time of 2.5 hours.
Hint: Try to use a heatmap as a plot!!!

{{Train No. for S1 to M1 train, Train No. for S2 to M1, {Train No. for all feasible train from M1 to C1}}, · · · {· · · }}

In case if no feasible mode is available for a certain combination of train S1, S2 return feasible solution as {ϕ}

Page 4

You might also like