首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
WIB1002编程辅导、讲解Java,c++程序、Python程序辅导 讲解数据库SQL|辅导Database
项目预算:
开发周期:
发布时间:
要求地区:
WIA/WIB1002 DS Assignment (S2, 2020/21) ‘Always on Time’ Delivery
1
‘Always On Time’ Delivery
Introduction
Your friend’s delivery company ‘Never On Time Sdn Bhd’ is receiving tons of complaints from
customers as they feel that the delivery process is far too slow. Delivery men in your friend’s
company are always lost in the middle of their delivery route, don’t know where to deliver the
parcel and which road they should take to shorten the delivery time. Sometimes they feel angry
and exhausted when they lose their direction and they eventually take it out on the parcels
which causes more complaints from customers. Your friend tried out many ways to solve the
problem but to no avail. Hence, you are your friend’s last hope to save his company.
Figure 1: Visualization of the problem’s underlying structure
Problem Statement
In this assignment, you as a professional engineer are requested to simulate the delivery
process and planning in a country to help your friend shorten their delivery time.
Basic Requirements
Let us start with definitions of all terms we are going to use in this problem context. A customer
is an entity that has a certain demand and therefore requires the presence of a vehicle, a unit
that can move between customers and the depot, a unit that initially possesses the demands
of the customers. All vehicles are capacitated that they can only contain goods (the customer’s
demands) up to a certain maximum capacity. Moving a vehicle between the depot and the
customers comes with a certain cost. A route is a sequence of visited customers by a certain
vehicle, starting and ending at a depot while a tour is a list of routes of all vehicles to fulfil all
customers’ demands.
You can imagine the underlying structure of this problem as a complete undirected graph
G(V, E). A simple visualization is given in the Fig. 1 above.
WIA/WIB1002 DS Assignment (S2, 2020/21) ‘Always on Time’ Delivery
2
Input
Given a text file, where the first row indicates the number of customers (including depot),
N and maximum capacity of all vehicles, C. After this, starting from second row onwards
are the N rows of information. In particular, every row of information contains 3 data, which
are x-coordinate, y-coordinate and lastly demand size of a customer. The second row
represents the depot and its demand size is always 0 while the rest of the rows show customer
information. An example of input is given below.
Figure 2: The format of the input file and the example input.
In Fig. 2, the left side of the figure shows the input file format, while the right side of the figure
shows an example of input text file. In this example, N=5 indicates that there are 4 customers
and a depot, and the maximum capacity for all vehicles you use is 10.
It is then followed by 5 rows of information. Second row of the example input indicates location
of the depot in x and y coordinates, (86, 22) and demand size is 0. The next 4 rows (viz., third
row to sixth row) show locations and demand size of every customer. For instance, the first
customer is located at (29, 17) with demand size of 1. In order for us to identify depot and
every customer, we simply give each one of them an ID according to their sequence in the
text file. For example, the depot located at (86, 22) is assigned an ID of 0, then the first
customer located at (29, 17) with demand size 1 is assigned an ID of 1, followed by ID 2 for
second customer at (4, 50) with demand size 8, etc.
Noted that Fig. 2 is only an example input, you may adjust input format for your own needs.
Given any input of this format, your task is to find out the best tour with lowest cost (a tour’s
cost is simply the summation of all routes’ costs while a route’s cost is simply the total
Euclidean distance travelled by the vehicle using that route). Note that this also means that
your program needs to find out what is the best number of vehicles to be used as well in order
to achieve the lowest cost.
WIA/WIB1002 DS Assignment (S2, 2020/21) ‘Always on Time’ Delivery
3
Output
There are total of 3 outputs you have to generate, we define each output as a simulation:
1. Let’s start with a simple one. In the first simulation, you are requested to find the best
tour for a given case with small N using Breadth-First Search / Depth-First Search
traversal implementation which you will learn in the class. We name this approach as
‘Basic Simulation’.
2. Secondly, you are requested to implement a Greedy Search that is able to find a good
solution given a case with small or large N. Greedy Search means we simply look for
the best option in the next move when we travel through the whole graph. For
illustration, in this context the vehicle will always looks for the shortest distance
between current location and all next possible location to select the next location to go.
A simple explanation will be given in the Github link provided in ‘Resource’ section. We
name this approach as ‘Greedy Simulation’.
3. Now, this is the most important part of this simulation. We want to search for the best
tour that we could search of in a limited computation time. This means that if we
are given enough time, then we will provide the best tour else we will just provide the
best tour we could find of if we are given a limited time with large N. Thus, we are going
to implement another searching algorithm, which is known as Monte Carlo Tree
Search. A brief explanation of this algorithm is given in the next section. We name this
approach as ‘MCTS Simulation’.
For every simulation, you need to show the tour’s cost, followed by every used vehicle’s
information which includes the route taken, vehicle’s used capacity and cost of the route
taken. Sample output is given below with the case of the sample input given in the previous
section.
Figure 3: Example output based on the input file in Fig. 2. You may output your simulations
one after another instead of side by side. It is put as side by side here just to save spaces.
WIA/WIB1002 DS Assignment (S2, 2020/21) ‘Always on Time’ Delivery
4
Monte Carlo Tree Search
In MCTS, nodes are the building blocks of the search tree. These nodes are formed based on
the outcome of a number of simulations. In general, MCTS selects next moves based on
certain strategies until the end (leaf node), and based on the evaluation of the status in leaf
node, we backpropagate the evaluation result to the root node to update the strategy so that
we can select a better move in next loop. The process of Monte Carlo Tree Search can be
broken down into four distinct steps, selection, expansion, simulation, and backpropagation
as shown in the figure below.
Figure 4: The Monte Carlo Tree Search process.
● Selection: In this process, the MCTS algorithm traverses the current tree from the root
node using a specific strategy. The strategy we are going to use to solve our problem
is policy adaptation. It is a bit long to be explained here and out of the scope of this
Data Structure course thus the full logic of selection will be provided. Based on the
policy, we select the ‘best child’ from all possible child nodes and enter the expansion
phase.
● Expansion: In this process, a new child node is added to the tree to that node which
was optimally reached during the selection process.
● Simulation: In this process, a simulation is performed by choosing moves or strategies
until a result or predefined state is achieved. We can choose those moves randomly,
to perform a random simulation, but for better efficiency, we choose the moves
according to policy.
● Backpropagation: After determining the value of the newly added node, the remaining
tree must be updated. So, the backpropagation process is performed, where it
backpropagates from the new node to the root node. During the process, the policy we
use to select moves is updated according to the cost of the result.
For your knowledge, MCTS was indeed successfully implemented in many real life
applications such as board games including Chess and Go (AlphaGo), protein folding
problems, chemical design applications, planning and logistics, building structural design,
interplanetary flights planning and is currently intended as one of the best approaches in
Artificial General Intelligence for games (AGI).
WIA/WIB1002 DS Assignment (S2, 2020/21) ‘Always on Time’ Delivery
5
Resources
I uploaded some of the sample inputs on my personal GitHub repository, where you can
access it through this link: Delivery-Instances (GitHub Repo). You might want to test your
program using the sample inputs provided there or you can simply generate inputs randomly
for your own sake. The sample inputs provided there follow the input format explained earlier
and if your program is receiving a different input format then you might need to change those
samples’ format after downloading them as well.
Inside the repository you will also find the implementation of MCTS, in pseudo-codes form,
and I believe you guys have the ability to figure out the complete implementation.
If you have any questions please feel free to raise it in the GitHub repo by creating a new issue.
I will check the repo from time to time and try to answer your questions. If you are unfamiliar
with GitHub, here is a documentation guide on how to create a new issue in a GitHub repo.
Extra: I might be putting more and more resources regarding the problems (some possible
new ideas for extra features of this problem or explanations about MCTS as well) for your
reading. If you are interested, can try checking the GitHub repo from time to time.
WIA/WIB1002 DS Assignment (S2, 2020/21) ‘Always on Time’ Delivery
6
Extra Features
Graphic User Interface (GUI)
Build your simulator with a nice looking GUI. You can either simulate it in a graph or in a graph
with a graphic map background. Your program should simulate the process of delivery
(movement of vehicles between locations with respect to time).
Random Parcel Pick Up Spawning
During the parcel delivery process, there might be customers requesting parcel pick up from
their home to be delivered to other places. Thus, in order to minimize cost, we have to update
the path used by couriers (vehicles) whenever there is a new request for parcel pickup from a
new location.
Pickup and Delivery
In this case, parcels are not initially located at the depot, instead parcels are on the customer's
site. For every customer, you need to send a vehicle to their location to pick up the parcel
(demand) and send it to another location specified by the customer (demand is released in
destination).
There are few things you might need to be careful of: first, a delivery point cannot come before
its respective pickup point when you find the best route for your couriers. Secondly, all vehicles
departing from the depot have 0 used capacity (as parcels are not inside the depot anymore).
When a vehicle reaches a pickup point, it decrements the available capacity in the vehicle as
it pickups the parcel. When a vehicle reaches a delivery point with its respective parcel, it
releases the parcel and thus increments back the available capacity of the vehicle.
Heterogeneous Vehicle Capacity
In basic requirements, we assume that every vehicle shares the same capacity, C. In fact, we
might have different types of vehicles that have different capacity (e.g. a lorry can deliver more
loads than a van). In order to produce a simulation closer to real life, you might need to
consider adding this feature.
Time constraint from customer
In real life, we not only have to minimize the time and fuel (represented by distance) used by
couriers, we also have to consider the expected arrival time of every parcel to their owners.
We should not deliver the parcel later than its expected arrival time as it would result in bad
customer reviews. In your simulation, you might want to add this feature as well.
For every customer, you might need to add a time window [t1, t2] to specify the time range we
can deliver a parcel to a customer. If we arrive at the customer location before t1, then we
have to wait for it and do nothing else, and if we deliver the parcel after t2, then we will receive
a penalty which is undesired. Thus, your tour should strictly follow the time window for every
customer and at the same time minimize the cost.
WIA/WIB1002 DS Assignment (S2, 2020/21) ‘Always on Time’ Delivery
7
Traffic Conditions
Traffic conditions for every road keep changing due to many reasons which we can’t predict
(accidents, peak hours, holiday seasons etc.). In your simulation, you can also simulate this
by assigning flexible time (that may change from time to time) to every road (connection
between nodes). When there are traffic condition changes, the path taken by every courier
that is affected should make some changes as well.
Site-Dependent Customer
Not every type of vehicle can serve every type of customer because of site-dependent
restrictions. For example, customers located in very narrow streets cannot be served by a very
big truck, and customers with very high demands require large vehicles. So associated with
each customer is a set of feasible vehicles but not all.
Extra Algorithm Implementation
You can implement other searching algorithms to search for a best-known path for the delivery
process. Here are some of the possible searching algorithm you might want to consider:
1. Best First Search
2. A* Search
3. Genetic Algorithm
4. Hybrid Search I (MCTS + GA)
5. Hybrid Search II (MCTS + ML)
6. Your custom searching algorithm
Parallelism (Threading)
You might want to apply parallel programming for the MCTS algorithm. For MCTS, simulations
made can be run parallelly to reduce time usage greatly so that we can get a better result with
shorter time for large N.
You can also apply parallel programming by parallelising the process of vehicle movement
and route searching. You can try to search a best next move first using MCTS, then while
vehicle is moving to the next location (which the process should take some times if you animate
your simulation), you can continue to search the next best move from the next location so that
you don’t have to waste so much time initially for searching the best whole route for every
vehicle before they depart.
END OF THE QUESTION
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做ceng0013 design of a pro...
2024-11-13
代做mech4880 refrigeration a...
2024-11-13
代做mcd1350: media studies a...
2024-11-13
代写fint b338f (autumn 2024)...
2024-11-13
代做engd3000 design of tunab...
2024-11-13
代做n1611 financial economet...
2024-11-13
代做econ 2331: economic and ...
2024-11-13
代做cs770/870 assignment 8代...
2024-11-13
代写amath 481/581 autumn qua...
2024-11-13
代做ccc8013 the process of s...
2024-11-13
代写csit040 – modern comput...
2024-11-13
代写econ 2070: introduc2on t...
2024-11-13
代写cct260, project 2 person...
2024-11-13
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!