Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
fuvidani committed Sep 16, 2018
2 parents 15a4af5 + f4d2647 commit cdc80fa
Show file tree
Hide file tree
Showing 50 changed files with 2,096 additions and 284 deletions.
29 changes: 23 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
Solver for the Electric Vehicle Routing Problem with Time Windows.

<p align="center">
<img src="http://ls11-www.cs.tu-dortmund.de/people/chimani/VehicleRouting/vr.png">
<img src="http://ls11-www.cs.tu-dortmund.de/people/chimani/VehicleRouting/vr.png"><br/>
<a href="http://ls11-www.cs.tu-dortmund.de/people/chimani/VehicleRouting/" target="_blank">Image Source<a/>
</p>

[Image Source](http://ls11-www.cs.tu-dortmund.de/people/chimani/VehicleRouting/)

## Problem description
In the E-VRPTW, a set of customers must be served by a fleet of battery electric
vehicles (BEV). The E-VRPTW extends the well-know [VRPTW](https://en.wikipedia.org/wiki/Vehicle_routing_problem),
Expand All @@ -20,7 +19,7 @@ More formal, the EVRPTW is defined on a complete directed graph G = (V,A)
consisting of a set of depot, customer, and recharging station nodes and a set of edges.
Each edge _(i, j)_ has a distance _d<sub>ij</sub>_ and a travel time _t<sub>ij</sub>_ associated and each traveled
edge consumes the amount of _r_ x _d<sub>ij</sub>_ of the remaining battery charge of the vehicle,
where _h_ denotes the constant charge consumption rate. Furthermore, a set of homogeneous
where _r_ denotes the constant charge consumption rate. Furthermore, a set of homogeneous
vehicles is given, where each vehicle has a maximal capacity of _C_ and is located, full
loaded at the depot. Each node has a positive demand _q<sub>i</sub>_, a service time _s<sub>i</sub>_ and a time
window [ _e<sub>i</sub>_, _l<sub>i</sub>_ ] assigned. The service must start within the given time window (thus,
Expand All @@ -34,13 +33,31 @@ served within their given time window. All routes must begin and end in the depo
the vehicle capacity and battery capacity must be respected. The objective function is
to minimize the total traveled distance.

## Implementation Details

Our E-VRPTW Solver consists of two parts:
1. Construction heuristic: [Time-Oriented, Nearest-Neighbor Heuristic](https://pubsonline.informs.org/doi/abs/10.1287/opre.35.2.254?journalCode=opre) (Solomon 1987)
2. Metaheuristic: For this part, we tried to implement a Hybrid VNS/TS metaheuristic proposed in the paper [The Electric Vehicle-Routing Problem with Time Windows and Recharging Stations](https://pubsonline.informs.org/doi/10.1287/trsc.2013.0490),
however our solution is not the most efficient one and requires further optimizations (especially in route representation)

Model objects like `EVRPTWInstance`, `Customer`, `Node` have been copied from the [E-VRPTW Solution Verifier (Java)](https://github.com/ghiermann/evrptw-verifier) implemented by @ghiermann.

See our [presentation slides](https://docs.google.com/presentation/d/1WnySkapfZkM57kC_8XTIKsyNZOhBhiNAdNTUWY201tQ/edit?usp=sharing) for more details.

## Usage

// to be written
See Main.kt for instance/plotting/performance-recording customizations.


## Contributions
Special thanks to my dear friend and colleague [David Molnar](https://github.com/dmolnar99)
for participating in this project.
for participating in this project:

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
| [<img src="https://avatars3.githubusercontent.com/u/16260193?s=400&v=4" width="100px;"/><br /><sub><b>David Molnar</b></sub>](https://github.com/dmolnar99)<br />[🤔](#ideas "Ideas and Planning") [💻](https://github.com/fuvidani/clickbait-defeater/commits?author=dmolnar99 "Code") [⚠️](https://github.com/fuvidani/clickbait-defeater/commits?author=dmolnar99 "Tests") |
| :---: |
<!-- ALL-CONTRIBUTORS-LIST:END -->

## License
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT). Feel free to
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ apply plugin: 'kotlin-allopen'
apply plugin: 'application'

group ='at.ac.tuwien.otl'
version = '1.0-SNAPSHOT'
version = '1.0.0'
mainClassName = 'at.ac.tuwien.otl.Main'

repositories {
Expand All @@ -32,6 +32,8 @@ dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
ktlint "com.github.shyiko:ktlint:0.23.0"
compile fileTree(dir: 'libs', include: '*.jar')
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.7'
compile group: 'org.graphstream', name: 'gs-core', version: '1.3'

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.0.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.0.3'
Expand Down
Binary file added plots/c103_21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plots/c105_21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plots/c204_21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plots/r102_21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plots/r107_21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plots/r205_21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plots/r211_21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plots/rc101_21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plots/rc106_21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added plots/rc203_21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 13 additions & 31 deletions solutions/c103_21_sol.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,14 @@
# solution for c103_21
2249.872316017405
D0, C20, C21, C22, C24, C29, C30, C26, C7, C3, D0
D0, C67, C65, C63, C62, C69, C68, C64, C41, C42, C44, D0
D0, C23, C25, C27, C28, C34, C36, D0
D0, C75, C1, C2, C4, C6, C9, D0
D0, C46, C45, C48, C50, C51, C52, C47, C43, D0
D0, C90, C89, C88, C85, C84, C83, C86, C87, C91, D0
D0, C74, C72, D0
D0, C40, C49, D0
D0, C10, C11, C5, D0
D0, C66, D0
D0, C8, D0
D0, C98, C95, C96, C99, D0
D0, C32, C31, C33, D0
D0, C61, D0
D0, C17, C18, C15, D0
D0, C59, C55, D0
D0, C14, D0
D0, C12, D0
D0, C82, D0
D0, S12, C39, C38, C37, C35, D0
D0, S4, C94, C93, C92, C97, C100, D0
D0, C13, D0
D0, C19, D0
D0, S7, C16, D0
D0, C57, D0
D0, S16, C53, C56, C54, D0
D0, S14, C60, C58, D0
D0, S20, C78, C79, C77, C76, C81, D0
D0, S18, C80, D0
D0, S20, C73, C70, C71, D0
1040.6671460064022
D0, C98, C96, C95, C94, C92, C93, C97, C100, C99, S3, D0
D0, S0, C52, C32, C33, C29, C24, C22, C21, D0
D0, S0, C91, C89, C88, C85, C84, C82, C83, C86, C87, C90, D0
D0, S1, C73, C70, C71, C76, C78, C81, S19, C63, D0
D0, C41, C40, C44, C45, C48, C51, C50, C47, C43, C46, C49, C42, D0
D0, C59, C60, C58, C56, C53, S16, C54, C55, C57, D0
D0, S0, C20, C25, C27, C28, C26, C10, C11, C9, C8, D0
D0, C23, C30, C34, C36, C39, C38, C37, C35, C31, S13, D0
D0, C75, C1, C2, C4, C6, C7, C3, C5, D0
D0, C67, C74, S19, C79, C77, C80, C72, C61, C62, D0
D0, C65, C69, C68, C64, C66, D0
D0, S7, C12, C14, C16, C19, C18, C17, C15, C13, D0
42 changes: 13 additions & 29 deletions solutions/c105_21_sol.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
# solution for c105_21
2029.2143728128362
D0, C20, C21, C25, C27, C30, C28, C26, C6, C7, D0
D0, C67, C65, C62, C64, C68, C69, C48, C46, C47, C43, D0
D0, C23, C22, C29, C32, C33, C31, D0
D0, C63, C74, C40, C42, C44, C45, C51, C50, D0
D0, C75, C1, C98, C95, D0
D0, C24, C34, C36, D0
D0, C41, C59, C55, D0
D0, C90, C87, C86, C82, C83, C84, C85, C88, D0
D0, C96, C2, C4, C3, D0
D0, C12, C10, D0
D0, S14, C60, C58, C56, C53, C54, C57, D0
D0, C14, C11, D0
D0, S7, C16, C19, C18, C17, C15, D0
D0, S12, C39, C38, C37, C35, D0
D0, S4, C94, C92, C93, C97, C100, C99, D0
D0, S20, C73, C70, C79, C77, C81, D0
D0, S20, C71, C76, C78, C72, D0
D0, C5, D0
D0, S18, C80, D0
D0, C9, D0
D0, C89, D0
D0, C61, D0
D0, C91, D0
D0, C49, D0
D0, C8, D0
D0, C66, D0
D0, C52, D0
D0, C13, D0
1034.4610777347145
D0, S0, C41, C40, C42, C44, C45, C48, C46, C47, C43, D0
D0, C90, C87, C86, C82, C83, C84, C85, C88, C89, C91, D0
D0, C20, C24, C32, C33, C31, S11, C51, C50, C52, C49, D0
D0, S0, C63, S19, C73, C70, C71, C76, C78, C81, S19, D0
D0, S0, C21, C22, C25, C27, C30, C28, C26, C10, C11, C9, C8, D0
D0, C59, C60, C58, C56, C53, S16, C54, C55, C57, D0
D0, C65, C74, S19, C79, C77, C80, C72, C61, C66, D0
D0, S0, S0, S7, C12, C14, C16, C19, C18, C17, C15, C13, D0
D0, C23, C29, C34, C36, C39, C38, C37, C35, S13, D0
D0, C75, C1, C2, C4, C6, C7, C3, C5, D0
D0, C67, C62, C64, C68, C69, D0
D0, S3, C98, C96, C95, C94, C92, C93, C97, C100, C99, D0
21 changes: 5 additions & 16 deletions solutions/c204_21_sol.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
# solution for c204_21
1553.1684430384391
D0, C93, C5, C75, C2, C1, C99, C100, C97, C95, C94, C98, C7, C3, C4, C89, C91, C90, D0
D0, C20, C22, C24, C30, C25, C9, C11, C13, C17, C19, C23, D0
D0, C48, C43, C42, C41, C45, C50, C51, C47, C46, C44, C57, C55, C54, C59, D0
D0, C67, C63, C62, C66, C69, C68, C65, C64, C61, C74, C87, C77, C88, D0
D0, C8, C10, C12, C26, C28, C29, C27, D0
D0, C84, C78, C85, C86, D0
D0, C49, C53, C56, C58, C60, C52, D0
D0, C34, C36, C37, C35, C33, C39, C38, C31, C32, C6, D0
D0, C76, C71, C79, C96, D0
D0, C73, C70, C81, D0
D0, C83, C82, C92, D0
D0, C15, C14, C16, C18, D0
D0, C40, C72, D0
D0, C80, D0
D0, C21, D0
656.6589467777569
D0, S0, C8, C10, C11, C9, C13, C15, C12, C14, C16, C19, C18, C17, C25, C23, C26, S10, C28, C34, C36, C39, C38, C37, C35, C31, C33, C32, C6, C29, C30, C27, C24, C22, C21, D0
D0, S0, C20, S0, C89, C4, C3, C7, C95, C94, C92, C97, C100, C99, C98, C1, C2, C75, C5, C93, D0
D0, S0, S0, C90, C91, C88, C86, C84, C83, C82, C85, S20, C76, C71, C70, C73, C80, C79, C81, C78, C77, C87, C96, C74, C72, C61, C64, C62, C63, D0
D0, C48, C43, C41, C42, C47, S13, C52, C50, C51, C45, C46, C44, C40, C60, C58, C56, C53, C54, C59, C57, C55, C49, C65, C68, C69, C66, C67, S0, D0
63 changes: 23 additions & 40 deletions solutions/r102_21_sol.txt
Original file line number Diff line number Diff line change
@@ -1,41 +1,24 @@
# solution for r102_21
2649.679439695821
D0, C53, C28, C40, C21, C2, C13, D0
D0, C94, C97, C98, C93, C100, C91, C59, D0
D0, C89, C18, C60, C5, C99, C27, D0
D0, C96, C6, C95, C87, D0
D0, C1, C70, C10, C52, D0
D0, C31, C62, C7, D0
D0, C58, C22, C75, D0
D0, C3, C81, C33, C50, D0
D0, C74, C56, C72, D0
D0, C68, C24, C80, D0
D0, C61, C16, C85, C92, D0
D0, C8, C45, C83, D0
D0, C69, C26, D0
D0, C55, C54, D0
D0, S4, C9, C34, C78, C29, D0
D0, S19, C25, C4, C73, D0
D0, S8, C47, C36, C48, C82, D0
D0, C84, D0
D0, C12, D0
D0, C79, C77, D0
D0, C76, D0
D0, S7, C19, C11, C63, D0
D0, C88, D0
D0, C17, D0
D0, S14, C43, C15, C42, D0
D0, S18, C39, C67, C23, D0
D0, S6, C90, C30, D0
D0, S6, C32, C20, C51, D0
D0, S10, C46, D0
D0, C37, D0
D0, C57, D0
D0, S12, C86, C44, D0
D0, S4, C66, C71, D0
D0, S11, C38, C14, D0
D0, C41, D0
D0, S4, C35, D0
D0, S4, C65, S5, D0
D0, S8, C64, S9, D0
D0, S8, C49, D0
1620.8181754580394
D0, S0, C18, C8, C46, C36, S8, C47, C48, C82, D0
D0, C70, C30, S0, D0
D0, C19, S8, S8, C64, C49, S8, D0
D0, C89, C5, C84, C45, C83, S9, D0
D0, C1, C66, C71, S4, C20, D0
D0, C21, C74, C56, S17, C75, C72, C73, C53, D0
D0, C6, D0
D0, S19, C25, C55, C54, C4, C26, D0
D0, S14, C43, C15, C42, C87, C57, C2, D0
D0, C50, C69, C27, D0
D0, C31, C10, C32, C90, S6, C63, C62, C88, D0
D0, C28, C68, C24, C80, C12, D0
D0, C40, C58, D0
D0, C61, C16, C91, C85, C93, C99, D0
D0, C96, C59, C98, C92, C95, C13, D0
D0, C3, C33, C79, C77, C76, D0
D0, C94, S11, C38, C14, C100, C97, D0
D0, S18, C39, C67, C23, S17, C22, C41, D0
D0, S7, C11, C7, C52, D0
D0, S0, C81, S4, S4, C34, C78, C29, D0
D0, S4, C65, C35, S4, C9, C51, D0
D0, C60, S10, C17, C86, C44, C37, D0
52 changes: 15 additions & 37 deletions solutions/r107_21_sol.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,16 @@
# solution for r107_21
2534.1151825762677
D0, C53, C58, C13, C94, C95, C97, C59, C93, C98, C100, C6, D0
D0, C28, C26, C40, C21, C74, C22, C73, D0
D0, C89, C18, C60, C83, C5, C84, D0
D0, C50, C33, C81, C9, D0
D0, C96, C61, C16, C91, C85, C92, D0
D0, C31, C70, C10, C62, C88, C27, D0
D0, C2, C75, C72, D0
D0, C1, C51, C3, C77, D0
D0, C80, C68, C24, C54, D0
D0, C52, C48, C82, D0
D0, C69, C30, D0
D0, C45, C8, D0
D0, C7, C19, D0
D0, C55, C4, D0
D0, C14, C99, D0
D0, S19, C25, C67, D0
D0, S7, C11, C63, C32, C90, D0
D0, S14, C43, C15, C42, C87, C57, D0
D0, S8, C47, C49, D0
D0, C12, D0
D0, C56, D0
D0, C79, C78, D0
D0, C20, D0
D0, C76, D0
D0, S4, C34, C35, D0
D0, S17, C23, C39, C41, D0
D0, C17, D0
D0, C37, D0
D0, C29, D0
D0, C44, D0
D0, S12, C86, D0
D0, S8, C36, C46, D0
D0, S4, C66, C71, D0
D0, S11, C38, D0
D0, S4, C65, D0
D0, S8, C64, D0
1265.6463007559603
D0, C83, C8, C45, C17, C84, S12, C86, C44, C100, C37, D0
D0, C96, C93, C61, C16, C85, C91, S11, C38, C14, D0
D0, C94, C95, C97, C92, C98, C59, C99, C6, D0
D0, C89, C5, C60, C7, C52, D0
D0, C53, C40, C21, C56, S17, C75, C72, C73, C74, C22, C41, D0
D0, S0, C1, C10, C62, S7, C63, C90, C32, C30, C70, D0
D0, S0, C18, C48, C47, S8, C49, C64, C11, S7, C88, D0
D0, C20, S4, C65, C66, S3, C69, C27, D0
D0, C26, C54, C24, C29, S1, C80, C12, D0
D0, S17, C23, C39, C67, C4, S19, C25, C55, D0
D0, S0, C31, C19, S8, C36, C46, C82, D0
D0, C50, C51, C33, C81, C78, C34, C35, S4, C71, C9, D0
D0, C58, C2, S14, C15, C43, C42, C57, C87, C13, D0
D0, C28, C68, C79, C3, C77, C76, D0
17 changes: 8 additions & 9 deletions solutions/r205_21_sol.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# solution for r205_21
1364.418713755443
D0, C27, C28, C53, C58, C40, C73, C22, C41, C56, C4, C12, C3, C29, C24, C51, D0
D0, C13, C95, C59, C99, C92, C100, C98, C37, C91, C85, C61, C16, C44, C86, C38, C17, C45, C82, C62, C11, C63, D0
D0, C26, C21, C72, C74, C75, C57, C87, C97, C94, C6, C89, C60, C83, C93, C96, C15, D0
D0, C52, C7, C88, C31, C69, C50, C30, C20, C66, C71, C9, C35, C47, D0
D0, C1, C70, C10, C90, C32, C64, C49, C36, D0
D0, C76, C77, C79, C81, C33, C78, C34, C68, C55, C39, C43, C84, C18, D0
D0, C2, C42, C14, C5, C8, C46, C48, C19, D0
D0, C80, C54, C25, C67, C23, C65, D0
1009.4129651594476
D0, S0, S0, D0
D0, C52, C7, C88, C31, C69, C30, C20, C50, D0
D0, S0, C13, C95, C92, C59, C99, C5, C8, C46, C48, C19, S5, C10, C32, C90, C63, C64, C49, C36, C47, C11, C62, D0
D0, S0, C70, C1, C76, C77, C79, C33, C81, C78, C34, C65, C66, C71, C35, C9, C51, C3, C29, C24, C12, D0
D0, C26, C54, C80, C68, C28, C27, C53, C58, D0
D0, C21, C72, C23, C67, C25, C55, C39, S17, C75, C74, C57, S14, C43, C87, C97, C37, C98, C93, C85, C16, C44, C38, C86, C17, C45, C82, D0
D0, C2, C42, C14, C100, C91, C61, C84, C83, C60, C18, C89, C6, C94, C96, C15, C41, C22, C56, C4, C73, C40, S0, D0
11 changes: 5 additions & 6 deletions solutions/r211_21_sol.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# solution for r211_21
1062.1554791026529
D0, C27, C28, C26, C21, C72, C74, C75, C56, C23, C39, C25, C55, C4, C73, C22, C41, C57, C87, C97, C37, C98, C85, C61, C16, C91, C93, C96, C94, C6, C89, C60, C45, C17, C86, D0
D0, C53, C58, C13, C95, C92, C59, C99, C5, C84, C83, C8, C46, C48, C19, C11, C63, C90, C32, C30, C20, C51, C9, C35, C71, C66, C10, C62, C31, C69, C3, C12, C40, D0
D0, C52, C18, C7, C88, C70, C1, C50, C76, C77, C68, C80, C54, C24, C29, C78, C33, C82, C47, C36, C49, C64, D0
D0, C2, C42, C100, C14, C44, C38, C43, C15, D0
D0, C79, C81, C34, C65, C67, D0
789.6589580510812
D0, S0, C28, C26, C21, C72, C23, C67, C39, C25, C55, C54, C68, C76, C77, C3, C79, C29, C24, C80, C12, C4, C56, C75, C41, C22, C74, C73, C40, D0
D0, C52, C18, C7, C88, C31, C70, C1, C50, C33, C81, C78, C34, C35, C65, C71, C66, C20, C9, C51, C30, C69, C27, S0, S0, D0
D0, S0, C53, C58, C2, C42, C14, C44, C86, C38, C43, C15, C57, C87, C97, C96, C94, C6, D0
D0, S0, C13, C95, C92, C37, C98, C100, C91, C16, C61, C85, C93, C59, C99, C5, C84, C8, C46, C19, C11, C62, C10, C32, C90, C63, C64, C49, C36, C47, C48, C82, C45, C17, C83, C60, C89, D0
Loading

0 comments on commit cdc80fa

Please sign in to comment.