Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Trains Scheduling Problem The tracks in the following figure show the routes of 5 trains, each starting from a starting station S i to a
Trains Scheduling Problem
The tracks in the following figure show the routes of trains, each starting from a starting
station to a terminating station The orange circles indicate the stations the trains must pass
through and the arrows indicate the track followed by each train. You may assume that the
trains take exactly one hour to move from one station to the next.
Given that the trains must begin their journeys in the morning, at either or we
would like to come up with a safe schedule assigning a valid starting time for all trains such that
the following constraints are satisfied:
No two trains arrive at any intersecting station at the same time. For example, Train and
Train cannot depart at the same time because they would collide at the next station
All trains must arrive at their final destination on or before :
When a train starts its journey, it can only terminate at the final destination.
Use this information to answer each of the following questions:
Question : Warm up
a Given that all trains must depart at either :: or : and looking at the track
travelled by Train what can you say about its departure time?
b If Train starts its journey at : list all the times that Train can safely depart?
c If Train starts at : and Train starts at : list all the times that Train can safely
depart?
Question : CSP Formulation
Formulate the train scheduling problem as a constraint satisfaction problem CSP by
providing each of the following:
a What are the variables for this problem? Denote those variables by x x
b What is the domain of each variable? Use the original definition without eliminating any
values.
c Provide a complete list of constraints using precise mathematical notation. For example,
you may say that x x where x and x are CSP variables. Hint: You should express
all your constraints using
Question : Backtracking Search
Based on your formulation in Question above, answer each of the following:
a Selecting variables in the order: Train Train Train Train Train and selecting
values to assign in the order: ::: draw the entire search tree that is
generated by the Backtracking Search algorithm until a successful complete assignment is
found. How many nodes are generated? Hint: many nodes are generated
b Suppose variables are selected in different order as in: Train Train Train Train
Train but with the same order of values, ::: Draw the entiresearch tree
that is generated by the Backtracking Search algorithm until a successful complete
assignment is found. Now, how many nodes are generated? Hint: a few nodes are
generated
c Compare your answers to a with b What do you observe? Does the order of
selecting variables and values matter in the Backtracking Search algorithm?
Question : Consistency Checks
As described in the lecture, there are many consistency checks that can be implement before
we start the Backtracking Search algorithm. The objective of these consistency checks is to
reduce the search space. Explore some of these:
a In your CSP formulation in you should have some unary constraints. Use these to
prune the domains of the concerned variables and list the updated domains.
b Draw the Constraints Graph based on your results in a above and apply Arc Consistency
on the graph to further prune the domains of the variables. List the updated domains.
Question : Variable and Value Ordering
As noted in question the order of variables and values isan important factor that determines
how efficient the Backtracking Search algorithm is To explore this, answer the following::
a Using the MinimumRemainingValue MRV heuristic, explain why it is best to start with
Train
b Having started with Train use the Degree heuristic to explain why it is best to use Train
next.
Question : Programming
Based on your updated domains in question b write a Python program using the PythonConstraint library similar to the examples given to you to solve this problem.
Note: You need to attach the source code and a screenshort of your output.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started