├── .gitignore ├── LICENSE.md ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── solvers │ │ ├── vrpBranchAndBoundSolverConfig.xml │ │ ├── vrpBruteForceSolverConfig.xml │ │ └── vrpFirstFitDecreasingSolverConfig.xml │ └── vrps │ │ ├── A-n32-k5.vrp │ │ ├── A-n33-k5.vrp │ │ ├── A-n33-k6.vrp │ │ ├── A-n34-k5.vrp │ │ ├── A-n36-k5.vrp │ │ ├── A-n37-k5.vrp │ │ ├── A-n37-k6.vrp │ │ ├── A-n38-k5.vrp │ │ ├── A-n39-k5.vrp │ │ ├── A-n39-k6.vrp │ │ ├── A-n44-k7.vrp │ │ ├── A-n45-k6.vrp │ │ ├── A-n45-k7.vrp │ │ ├── A-n46-k7.vrp │ │ ├── A-n48-k7.vrp │ │ ├── A-n53-k7.vrp │ │ ├── A-n54-k7.vrp │ │ ├── A-n55-k9.vrp │ │ ├── A-n60-k9.vrp │ │ ├── A-n61-k9.vrp │ │ ├── A-n62-k8.vrp │ │ ├── A-n63-k10.vrp │ │ ├── A-n63-k9.vrp │ │ ├── A-n64-k9.vrp │ │ ├── A-n65-k9.vrp │ │ ├── A-n69-k9.vrp │ │ ├── A-n80-k10.vrp │ │ ├── F-n135-k7.vrp │ │ ├── F-n45-k4.vrp │ │ ├── F-n72-k4.vrp │ │ ├── tutorial-01-uncapacitated.vrp │ │ ├── tutorial-02-capacitated.vrp │ │ ├── tutorial-03-capacitated-hard.vrp │ │ ├── tutorial-04-capacitated-extra-vehicle.vrp │ │ ├── tutorial-05-timewindowed-uncapacitated.vrp │ │ └── tutorial-06-timewindowed-capacitated.vrp │ ├── java │ └── org │ │ ├── optaplanner │ │ ├── examples │ │ │ ├── common │ │ │ │ ├── domain │ │ │ │ │ └── AbstractPersistable.java │ │ │ │ └── persistence │ │ │ │ │ └── TxtInputBuilder.java │ │ │ └── vehiclerouting │ │ │ │ ├── domain │ │ │ │ ├── Customer.java │ │ │ │ ├── Depot.java │ │ │ │ ├── Standstill.java │ │ │ │ ├── Vehicle.java │ │ │ │ ├── VehicleRoutingSolution.java │ │ │ │ ├── location │ │ │ │ │ ├── AirLocation.java │ │ │ │ │ ├── DistanceType.java │ │ │ │ │ ├── Location.java │ │ │ │ │ ├── RoadLocation.java │ │ │ │ │ └── segmented │ │ │ │ │ │ ├── HubSegmentLocation.java │ │ │ │ │ │ └── RoadSegmentLocation.java │ │ │ │ ├── solver │ │ │ │ │ └── DepotAngleCustomerDifficultyWeightFactory.java │ │ │ │ └── timewindowed │ │ │ │ │ ├── TimeWindowedCustomer.java │ │ │ │ │ ├── TimeWindowedDepot.java │ │ │ │ │ ├── TimeWindowedVehicleRoutingSolution.java │ │ │ │ │ └── solver │ │ │ │ │ └── ArrivalTimeUpdatingVariableListener.java │ │ │ │ ├── persistence │ │ │ │ ├── VehicleRoutingImporter.java │ │ │ │ └── VehicleRoutingInputBuilder.java │ │ │ │ └── solver │ │ │ │ └── score │ │ │ │ └── VehicleRoutingEasyScoreCalculator.java │ │ └── persistence │ │ │ └── xstream │ │ │ └── impl │ │ │ └── score │ │ │ ├── XStreamBendableScoreConverter.java │ │ │ └── XStreamScoreConverter.java │ │ └── tomasdavid │ │ └── vehicleroutingproblem │ │ ├── MainActivity.java │ │ ├── VrpKeys.java │ │ ├── adapters │ │ ├── StatisticItem.java │ │ ├── StatisticsListAdapter.java │ │ ├── VrpFileItemViewHolder.java │ │ └── VrpFileListAdapter.java │ │ ├── components │ │ ├── AboutAppDialog.java │ │ ├── LegendDialog.java │ │ ├── OpenFileButton.java │ │ ├── StopSolverDialog.java │ │ └── VrpView.java │ │ ├── fragments │ │ ├── MainFragment.java │ │ ├── VrpFileListFragment.java │ │ └── VrpFragment.java │ │ ├── painter │ │ ├── VrpPainter.java │ │ └── VrpTranslator.java │ │ └── tasks │ │ ├── ProgressBarTask.java │ │ └── VrpSolverTask.java │ └── res │ ├── drawable-hdpi │ ├── depot.png │ ├── ic_help_white_24dp.png │ ├── ic_info_white_24dp.png │ ├── ic_launcher.png │ ├── ic_menu_white_24dp.png │ ├── ic_more_vert_white_24dp.png │ ├── ic_play_arrow_white_24dp.png │ ├── ic_stop_white_24dp.png │ ├── vehicle_blue.png │ ├── vehicle_brown.png │ ├── vehicle_green.png │ ├── vehicle_orange.png │ ├── vehicle_purple.png │ ├── vehicle_red.png │ └── vehicle_yellow.png │ ├── drawable-mdpi │ ├── depot.png │ ├── ic_help_white_24dp.png │ ├── ic_info_white_24dp.png │ ├── ic_launcher.png │ ├── ic_menu_white_24dp.png │ ├── ic_more_vert_white_24dp.png │ ├── ic_play_arrow_white_24dp.png │ ├── ic_stop_white_24dp.png │ ├── vehicle_blue.png │ ├── vehicle_brown.png │ ├── vehicle_green.png │ ├── vehicle_orange.png │ ├── vehicle_purple.png │ ├── vehicle_red.png │ └── vehicle_yellow.png │ ├── drawable-xhdpi │ ├── depot.png │ ├── ic_help_white_24dp.png │ ├── ic_info_white_24dp.png │ ├── ic_launcher.png │ ├── ic_menu_white_24dp.png │ ├── ic_more_vert_white_24dp.png │ ├── ic_play_arrow_white_24dp.png │ ├── ic_stop_white_24dp.png │ ├── vehicle_blue.png │ ├── vehicle_brown.png │ ├── vehicle_green.png │ ├── vehicle_orange.png │ ├── vehicle_purple.png │ ├── vehicle_red.png │ └── vehicle_yellow.png │ ├── drawable-xxhdpi │ ├── depot.png │ ├── ic_help_white_24dp.png │ ├── ic_info_white_24dp.png │ ├── ic_launcher.png │ ├── ic_menu_white_24dp.png │ ├── ic_more_vert_white_24dp.png │ ├── ic_play_arrow_white_24dp.png │ ├── ic_stop_white_24dp.png │ ├── vehicle_blue.png │ ├── vehicle_brown.png │ ├── vehicle_green.png │ ├── vehicle_orange.png │ ├── vehicle_purple.png │ ├── vehicle_red.png │ └── vehicle_yellow.png │ ├── drawable-xxxhdpi │ ├── depot.png │ ├── ic_help_white_24dp.png │ ├── ic_info_white_24dp.png │ ├── ic_launcher.png │ ├── ic_menu_white_24dp.png │ ├── ic_more_vert_white_24dp.png │ ├── ic_play_arrow_white_24dp.png │ ├── ic_stop_white_24dp.png │ ├── vehicle_blue.png │ ├── vehicle_brown.png │ ├── vehicle_green.png │ ├── vehicle_orange.png │ ├── vehicle_purple.png │ ├── vehicle_red.png │ └── vehicle_yellow.png │ ├── drawable │ ├── _pre_production │ │ └── ic_launcher.svg │ ├── shape_customer.xml │ ├── shape_dash_line.xml │ └── shape_line.xml │ ├── layout │ ├── activity_main.xml │ ├── dialog_info.xml │ ├── dialog_legend.xml │ ├── fragment_main.xml │ ├── fragment_vrp.xml │ ├── fragment_vrp_file_list.xml │ ├── item_statistic.xml │ └── item_vrp_file.xml │ ├── menu │ └── menu_vrp.xml │ └── values │ ├── arrays.xml │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ ├── styles.xml │ └── themes.xml ├── build.gradle ├── gradle.properties └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | .idea 3 | .DS_Store 4 | gradlew 5 | gradlew.bat 6 | /local.properties 7 | /build 8 | /*.iml 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vehicle Routing Problem application 2 | 3 | The Application demonstrate OptaPlanner functionality on the Android platform. 4 | 5 | ## How to build and run this application 6 | 7 | To build and run the application follow these steps: 8 | 9 | 1. Download android-sdk. 10 | 2. Clone this project. 11 | 3. Create `local.properties` file with one property `sdk.dir=.../android-sdk`. 12 | 4. Run `gradle build`. 13 | 5. Run `gradle assembleDebug`. 14 | 6. Run `adb install app/build/outputs/apk/app-debug.apk`. 15 | 7. Open application in device. 16 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /*.iml 3 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | buildToolsVersion "28.0.2" 6 | 7 | defaultConfig { 8 | applicationId "org.tomasdavid.vehicleroutingproblem" 9 | minSdkVersion 22 10 | targetSdkVersion 28 11 | versionCode 5 12 | versionName "1.1-final" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | lintOptions { 21 | abortOnError false 22 | } 23 | packagingOptions { 24 | exclude 'META-INF/LICENSE.txt' 25 | exclude 'META-INF/NOTICE.txt' 26 | } 27 | compileOptions { 28 | sourceCompatibility JavaVersion.VERSION_1_8 29 | targetCompatibility JavaVersion.VERSION_1_8 30 | } 31 | // version 6.2.0 requires core library flag to allow JavaBeans core classes 32 | /* 33 | dexOptions { 34 | preDexLibraries = false 35 | } 36 | project.tasks.withType(com.android.build.gradle.tasks.Dex) { 37 | additionalParameters=['--core-library'] 38 | } 39 | */ 40 | } 41 | 42 | dependencies { 43 | implementation fileTree(dir: 'libs', include: ['*.jar']) 44 | implementation 'com.android.support:appcompat-v7:22.2.0' 45 | implementation 'com.android.support:recyclerview-v7:22.2.0' 46 | implementation ('org.optaplanner:optaplanner-core:6.3.0-SNAPSHOT') { 47 | exclude group: 'xmlpull' 48 | exclude group: 'org.drools' 49 | // todo exclude, didn't work on optaplanner 6.1.0 50 | //exclude group: 'org.kie' 51 | } 52 | 53 | // version 6.1.0 requires some classes from drools-core even if java score calculation is used 54 | /* 55 | compile ('org.drools:drools-core:6.1.0.Final') { 56 | transitive = false 57 | } 58 | */ 59 | } 60 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/tdavid/Aplikace/android-sdk-linux/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 27 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/assets/solvers/vrpBranchAndBoundSolverConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution 4 | org.optaplanner.examples.vehiclerouting.domain.Standstill 5 | org.optaplanner.examples.vehiclerouting.domain.Customer 6 | org.optaplanner.examples.vehiclerouting.domain.timewindowed.TimeWindowedCustomer 7 | 8 | 9 | HARD_SOFT 10 | org.optaplanner.examples.vehiclerouting.solver.score.VehicleRoutingEasyScoreCalculator 11 | ONLY_DOWN 12 | 13 | 14 | 15 | 16 | 10 17 | 18 | 19 | 20 | BRANCH_AND_BOUND 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/assets/solvers/vrpBruteForceSolverConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution 4 | org.optaplanner.examples.vehiclerouting.domain.Standstill 5 | org.optaplanner.examples.vehiclerouting.domain.Customer 6 | org.optaplanner.examples.vehiclerouting.domain.timewindowed.TimeWindowedCustomer 7 | 8 | 9 | HARD_SOFT 10 | org.optaplanner.examples.vehiclerouting.solver.score.VehicleRoutingEasyScoreCalculator 11 | ONLY_DOWN 12 | 13 | 14 | 15 | 16 | 10 17 | 18 | 19 | 20 | BRUTE_FORCE 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/assets/solvers/vrpFirstFitDecreasingSolverConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution 4 | org.optaplanner.examples.vehiclerouting.domain.Standstill 5 | org.optaplanner.examples.vehiclerouting.domain.Customer 6 | org.optaplanner.examples.vehiclerouting.domain.timewindowed.TimeWindowedCustomer 7 | 8 | 9 | HARD_SOFT 10 | org.optaplanner.examples.vehiclerouting.solver.score.VehicleRoutingEasyScoreCalculator 11 | ONLY_DOWN 12 | 13 | 14 | 15 | 16 | 10 17 | 18 | 19 | 20 | FIRST_FIT_DECREASING 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | true 29 | 30 | 31 | true 32 | 33 | 34 | 35 | 200 36 | 37 | 38 | 1 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n32-k5.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n32-k5 2 | COMMENT : (Augerat et al, Min no of trucks: 5, Optimal value: 784) 3 | TYPE : CVRP 4 | DIMENSION : 32 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 82 76 9 | 2 96 44 10 | 3 50 5 11 | 4 49 8 12 | 5 13 7 13 | 6 29 89 14 | 7 58 30 15 | 8 84 39 16 | 9 14 24 17 | 10 2 39 18 | 11 3 82 19 | 12 5 10 20 | 13 98 52 21 | 14 84 25 22 | 15 61 59 23 | 16 1 65 24 | 17 88 51 25 | 18 91 2 26 | 19 19 32 27 | 20 93 3 28 | 21 50 93 29 | 22 98 14 30 | 23 5 42 31 | 24 42 9 32 | 25 61 62 33 | 26 9 97 34 | 27 80 55 35 | 28 57 69 36 | 29 23 15 37 | 30 20 70 38 | 31 85 60 39 | 32 98 5 40 | DEMAND_SECTION 41 | 1 0 42 | 2 19 43 | 3 21 44 | 4 6 45 | 5 19 46 | 6 7 47 | 7 12 48 | 8 16 49 | 9 6 50 | 10 16 51 | 11 8 52 | 12 14 53 | 13 21 54 | 14 16 55 | 15 3 56 | 16 22 57 | 17 18 58 | 18 19 59 | 19 1 60 | 20 24 61 | 21 8 62 | 22 12 63 | 23 4 64 | 24 8 65 | 25 24 66 | 26 24 67 | 27 2 68 | 28 20 69 | 29 15 70 | 30 2 71 | 31 14 72 | 32 9 73 | DEPOT_SECTION 74 | 1 75 | -1 76 | EOF 77 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n33-k5.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n33-k5 2 | COMMENT : (Augerat et al, Min no of trucks: 5, Optimal value: 661) 3 | TYPE : CVRP 4 | DIMENSION : 33 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 42 68 9 | 2 77 97 10 | 3 28 64 11 | 4 77 39 12 | 5 32 33 13 | 6 32 8 14 | 7 42 92 15 | 8 8 3 16 | 9 7 14 17 | 10 82 17 18 | 11 48 13 19 | 12 53 82 20 | 13 39 27 21 | 14 7 24 22 | 15 67 98 23 | 16 54 52 24 | 17 72 43 25 | 18 73 3 26 | 19 59 77 27 | 20 58 97 28 | 21 23 43 29 | 22 68 98 30 | 23 47 62 31 | 24 52 72 32 | 25 32 88 33 | 26 39 7 34 | 27 17 8 35 | 28 38 7 36 | 29 58 74 37 | 30 82 67 38 | 31 42 7 39 | 32 68 82 40 | 33 7 48 41 | DEMAND_SECTION 42 | 1 0 43 | 2 5 44 | 3 23 45 | 4 14 46 | 5 13 47 | 6 8 48 | 7 18 49 | 8 19 50 | 9 10 51 | 10 18 52 | 11 20 53 | 12 5 54 | 13 9 55 | 14 23 56 | 15 9 57 | 16 18 58 | 17 10 59 | 18 24 60 | 19 13 61 | 20 14 62 | 21 8 63 | 22 10 64 | 23 19 65 | 24 14 66 | 25 13 67 | 26 14 68 | 27 2 69 | 28 23 70 | 29 15 71 | 30 8 72 | 31 20 73 | 32 24 74 | 33 3 75 | DEPOT_SECTION 76 | 1 77 | -1 78 | EOF 79 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n33-k6.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n33-k6 2 | COMMENT : (Augerat et al, Min no of trucks: 6, Optimal value: 742) 3 | TYPE : CVRP 4 | DIMENSION : 33 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 34 31 9 | 2 45 55 10 | 3 70 80 11 | 4 81 70 12 | 5 85 61 13 | 6 59 55 14 | 7 45 60 15 | 8 50 64 16 | 9 80 64 17 | 10 75 90 18 | 11 25 40 19 | 12 9 66 20 | 13 1 44 21 | 14 50 54 22 | 15 35 45 23 | 16 71 84 24 | 17 1 9 25 | 18 25 54 26 | 19 45 59 27 | 20 45 71 28 | 21 66 84 29 | 22 11 35 30 | 23 81 46 31 | 24 85 10 32 | 25 75 20 33 | 26 15 21 34 | 27 90 45 35 | 28 15 0 36 | 29 31 26 37 | 30 10 95 38 | 31 6 6 39 | 32 51 5 40 | 33 26 36 41 | DEMAND_SECTION 42 | 1 0 43 | 2 26 44 | 3 17 45 | 4 6 46 | 5 15 47 | 6 7 48 | 7 5 49 | 8 15 50 | 9 16 51 | 10 17 52 | 11 1 53 | 12 21 54 | 13 66 55 | 14 25 56 | 15 16 57 | 16 11 58 | 17 7 59 | 18 17 60 | 19 17 61 | 20 22 62 | 21 10 63 | 22 25 64 | 23 16 65 | 24 7 66 | 25 21 67 | 26 11 68 | 27 21 69 | 28 11 70 | 29 21 71 | 30 22 72 | 31 25 73 | 32 2 74 | 33 22 75 | DEPOT_SECTION 76 | 1 77 | -1 78 | EOF 79 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n34-k5.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n34-k5 2 | COMMENT : (Augerat et al, Min no of trucks: 5, Optimal value: 778) 3 | TYPE : CVRP 4 | DIMENSION : 34 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 73 39 9 | 2 67 91 10 | 3 39 21 11 | 4 3 9 12 | 5 97 15 13 | 6 91 65 14 | 7 55 75 15 | 8 55 71 16 | 9 57 85 17 | 10 21 15 18 | 11 47 57 19 | 12 51 97 20 | 13 11 11 21 | 14 43 59 22 | 15 63 69 23 | 16 55 77 24 | 17 35 11 25 | 18 27 91 26 | 19 49 25 27 | 20 29 93 28 | 21 71 27 29 | 22 31 43 30 | 23 27 9 31 | 24 67 99 32 | 25 87 81 33 | 26 23 81 34 | 27 89 33 35 | 28 71 91 36 | 29 19 77 37 | 30 65 77 38 | 31 87 79 39 | 32 19 83 40 | 33 1 59 41 | 34 55 7 42 | DEMAND_SECTION 43 | 1 0 44 | 2 23 45 | 3 3 46 | 4 24 47 | 5 15 48 | 6 15 49 | 7 24 50 | 8 7 51 | 9 25 52 | 10 13 53 | 11 5 54 | 12 7 55 | 13 5 56 | 14 14 57 | 15 13 58 | 16 5 59 | 17 24 60 | 18 15 61 | 19 9 62 | 20 16 63 | 21 13 64 | 22 16 65 | 23 13 66 | 24 24 67 | 25 20 68 | 26 23 69 | 27 20 70 | 28 3 71 | 29 15 72 | 30 12 73 | 31 19 74 | 32 4 75 | 33 15 76 | 34 1 77 | DEPOT_SECTION 78 | 1 79 | -1 80 | EOF 81 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n36-k5.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n36-k5 2 | COMMENT : (Augerat et al, Min no of trucks: 5, Optimal value: 799) 3 | TYPE : CVRP 4 | DIMENSION : 36 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 15 19 9 | 2 1 49 10 | 3 87 25 11 | 4 69 65 12 | 5 93 91 13 | 6 33 31 14 | 7 71 61 15 | 8 29 9 16 | 9 93 7 17 | 10 55 47 18 | 11 23 13 19 | 12 19 47 20 | 13 57 63 21 | 14 5 95 22 | 15 65 43 23 | 16 69 1 24 | 17 3 25 25 | 18 19 91 26 | 19 21 81 27 | 20 67 91 28 | 21 41 23 29 | 22 19 75 30 | 23 15 79 31 | 24 79 47 32 | 25 19 65 33 | 26 27 49 34 | 27 29 17 35 | 28 25 65 36 | 29 59 51 37 | 30 27 95 38 | 31 21 91 39 | 32 61 83 40 | 33 15 83 41 | 34 31 87 42 | 35 71 41 43 | 36 91 21 44 | DEMAND_SECTION 45 | 1 0 46 | 2 1 47 | 3 14 48 | 4 15 49 | 5 11 50 | 6 18 51 | 7 2 52 | 8 22 53 | 9 7 54 | 10 18 55 | 11 23 56 | 12 12 57 | 13 21 58 | 14 2 59 | 15 14 60 | 16 9 61 | 17 10 62 | 18 4 63 | 19 19 64 | 20 2 65 | 21 20 66 | 22 15 67 | 23 11 68 | 24 6 69 | 25 13 70 | 26 19 71 | 27 13 72 | 28 8 73 | 29 15 74 | 30 18 75 | 31 11 76 | 32 21 77 | 33 12 78 | 34 2 79 | 35 23 80 | 36 11 81 | DEPOT_SECTION 82 | 1 83 | -1 84 | EOF 85 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n37-k5.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n37-k5 2 | COMMENT : (Augerat et al, Min no of trucks: 5, Optimal value: 669) 3 | TYPE : CVRP 4 | DIMENSION : 37 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 38 46 9 | 2 59 46 10 | 3 96 42 11 | 4 47 61 12 | 5 26 15 13 | 6 66 6 14 | 7 96 7 15 | 8 37 25 16 | 9 68 92 17 | 10 78 84 18 | 11 82 28 19 | 12 93 90 20 | 13 74 42 21 | 14 60 20 22 | 15 78 58 23 | 16 36 48 24 | 17 45 36 25 | 18 73 57 26 | 19 10 91 27 | 20 98 51 28 | 21 92 62 29 | 22 43 42 30 | 23 53 25 31 | 24 78 65 32 | 25 72 79 33 | 26 37 88 34 | 27 16 73 35 | 28 75 96 36 | 29 11 66 37 | 30 9 49 38 | 31 25 72 39 | 32 8 68 40 | 33 12 61 41 | 34 50 2 42 | 35 26 54 43 | 36 18 89 44 | 37 22 53 45 | DEMAND_SECTION 46 | 1 0 47 | 2 16 48 | 3 18 49 | 4 1 50 | 5 13 51 | 6 8 52 | 7 23 53 | 8 7 54 | 9 27 55 | 10 1 56 | 11 3 57 | 12 6 58 | 13 24 59 | 14 19 60 | 15 2 61 | 16 5 62 | 17 16 63 | 18 7 64 | 19 4 65 | 20 22 66 | 21 7 67 | 22 23 68 | 23 16 69 | 24 2 70 | 25 2 71 | 26 9 72 | 27 2 73 | 28 12 74 | 29 1 75 | 30 9 76 | 31 23 77 | 32 6 78 | 33 19 79 | 34 7 80 | 35 7 81 | 36 20 82 | 37 20 83 | DEPOT_SECTION 84 | 1 85 | -1 86 | EOF 87 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n37-k6.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n37-k6 2 | COMMENT : (Augerat et al, Min no of trucks: 6, Optimal value: 949) 3 | TYPE : CVRP 4 | DIMENSION : 37 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 86 22 9 | 2 29 17 10 | 3 4 50 11 | 4 25 13 12 | 5 67 37 13 | 6 13 7 14 | 7 62 15 15 | 8 84 38 16 | 9 34 3 17 | 10 19 45 18 | 11 42 76 19 | 12 40 86 20 | 13 25 94 21 | 14 63 57 22 | 15 75 24 23 | 16 61 85 24 | 17 87 38 25 | 18 54 39 26 | 19 66 34 27 | 20 46 39 28 | 21 47 17 29 | 22 21 54 30 | 23 19 83 31 | 24 1 82 32 | 25 94 28 33 | 26 82 72 34 | 27 41 59 35 | 28 100 77 36 | 29 1 57 37 | 30 96 7 38 | 31 57 82 39 | 32 47 38 40 | 33 68 89 41 | 34 16 36 42 | 35 51 38 43 | 36 83 74 44 | 37 84 2 45 | DEMAND_SECTION 46 | 1 0 47 | 2 1 48 | 3 23 49 | 4 23 50 | 5 5 51 | 6 7 52 | 7 18 53 | 8 12 54 | 9 20 55 | 10 19 56 | 11 19 57 | 12 16 58 | 13 2 59 | 14 26 60 | 15 13 61 | 16 19 62 | 17 17 63 | 18 14 64 | 19 8 65 | 20 10 66 | 21 5 67 | 22 19 68 | 23 12 69 | 24 9 70 | 25 18 71 | 26 4 72 | 27 20 73 | 28 8 74 | 29 3 75 | 30 18 76 | 31 26 77 | 32 21 78 | 33 21 79 | 34 8 80 | 35 19 81 | 36 66 82 | 37 21 83 | DEPOT_SECTION 84 | 1 85 | -1 86 | EOF 87 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n38-k5.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n38-k5 2 | COMMENT : (Augerat et al, Min no of trucks: 5, Optimal value: 730) 3 | TYPE : CVRP 4 | DIMENSION : 38 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 69 63 9 | 2 3 35 10 | 3 71 79 11 | 4 1 47 12 | 5 11 15 13 | 6 87 23 14 | 7 37 33 15 | 8 87 29 16 | 9 35 81 17 | 10 55 71 18 | 11 41 51 19 | 12 93 9 20 | 13 11 49 21 | 14 75 89 22 | 15 75 69 23 | 16 97 95 24 | 17 15 13 25 | 18 63 95 26 | 19 47 41 27 | 20 45 41 28 | 21 89 43 29 | 22 45 59 30 | 23 95 23 31 | 24 19 83 32 | 25 71 69 33 | 26 27 19 34 | 27 17 57 35 | 28 93 15 36 | 29 59 29 37 | 30 35 39 38 | 31 33 51 39 | 32 61 21 40 | 33 89 53 41 | 34 33 85 42 | 35 37 37 43 | 36 21 91 44 | 37 67 95 45 | 38 61 15 46 | DEMAND_SECTION 47 | 1 0 48 | 2 12 49 | 3 5 50 | 4 8 51 | 5 12 52 | 6 18 53 | 7 12 54 | 8 11 55 | 9 19 56 | 10 23 57 | 11 8 58 | 12 25 59 | 13 1 60 | 14 5 61 | 15 17 62 | 16 13 63 | 17 9 64 | 18 13 65 | 19 19 66 | 20 5 67 | 21 26 68 | 22 9 69 | 23 20 70 | 24 21 71 | 25 8 72 | 26 12 73 | 27 13 74 | 28 12 75 | 29 4 76 | 30 19 77 | 31 25 78 | 32 7 79 | 33 3 80 | 34 2 81 | 35 24 82 | 36 13 83 | 37 14 84 | 38 14 85 | DEPOT_SECTION 86 | 1 87 | -1 88 | EOF 89 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n39-k5.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n39-k5 2 | COMMENT : (Augerat et al, Min no of trucks: 5, Optimal value: 822) 3 | TYPE : CVRP 4 | DIMENSION : 39 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 9 35 9 | 2 43 19 10 | 3 79 35 11 | 4 93 7 12 | 5 13 35 13 | 6 67 13 14 | 7 31 77 15 | 8 81 7 16 | 9 27 49 17 | 10 27 35 18 | 11 69 23 19 | 12 31 51 20 | 13 27 27 21 | 14 15 83 22 | 15 7 35 23 | 16 53 25 24 | 17 75 13 25 | 18 47 49 26 | 19 25 33 27 | 20 1 23 28 | 21 45 11 29 | 22 1 47 30 | 23 93 15 31 | 24 41 9 32 | 25 75 55 33 | 26 3 1 34 | 27 51 67 35 | 28 57 91 36 | 29 21 97 37 | 30 55 13 38 | 31 3 71 39 | 32 37 19 40 | 33 73 21 41 | 34 19 19 42 | 35 75 73 43 | 36 93 49 44 | 37 41 87 45 | 38 97 73 46 | 39 45 29 47 | DEMAND_SECTION 48 | 1 0 49 | 2 5 50 | 3 24 51 | 4 3 52 | 5 20 53 | 6 26 54 | 7 23 55 | 8 15 56 | 9 3 57 | 10 20 58 | 11 16 59 | 12 9 60 | 13 21 61 | 14 3 62 | 15 24 63 | 16 14 64 | 17 6 65 | 18 6 66 | 19 13 67 | 20 5 68 | 21 3 69 | 22 3 70 | 23 20 71 | 24 16 72 | 25 22 73 | 26 10 74 | 27 12 75 | 28 20 76 | 29 24 77 | 30 6 78 | 31 1 79 | 32 2 80 | 33 13 81 | 34 7 82 | 35 6 83 | 36 24 84 | 37 19 85 | 38 4 86 | 39 7 87 | DEPOT_SECTION 88 | 1 89 | -1 90 | EOF 91 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n39-k6.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n39-k6 2 | COMMENT : (Augerat et al, Min no of trucks: 6, Optimal value: 831) 3 | TYPE : CVRP 4 | DIMENSION : 39 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 39 19 9 | 2 79 19 10 | 3 41 79 11 | 4 25 31 12 | 5 63 93 13 | 6 33 5 14 | 7 69 17 15 | 8 57 73 16 | 9 53 75 17 | 10 1 1 18 | 11 79 73 19 | 12 59 5 20 | 13 1 37 21 | 14 41 31 22 | 15 23 73 23 | 16 37 27 24 | 17 85 93 25 | 18 93 13 26 | 19 85 45 27 | 20 49 91 28 | 21 55 43 29 | 22 83 29 30 | 23 93 49 31 | 24 87 23 32 | 25 31 23 33 | 26 19 97 34 | 27 41 9 35 | 28 83 61 36 | 29 9 7 37 | 30 13 13 38 | 31 43 37 39 | 32 13 61 40 | 33 71 51 41 | 34 45 93 42 | 35 93 55 43 | 36 5 97 44 | 37 81 11 45 | 38 7 53 46 | 39 7 41 47 | DEMAND_SECTION 48 | 1 0 49 | 2 18 50 | 3 16 51 | 4 22 52 | 5 24 53 | 6 3 54 | 7 19 55 | 8 6 56 | 9 6 57 | 10 6 58 | 11 12 59 | 12 18 60 | 13 16 61 | 14 72 62 | 15 7 63 | 16 16 64 | 17 23 65 | 18 4 66 | 19 22 67 | 20 23 68 | 21 7 69 | 22 11 70 | 23 11 71 | 24 1 72 | 25 22 73 | 26 16 74 | 27 15 75 | 28 7 76 | 29 5 77 | 30 22 78 | 31 9 79 | 32 10 80 | 33 11 81 | 34 9 82 | 35 3 83 | 36 7 84 | 37 15 85 | 38 10 86 | 39 2 87 | DEPOT_SECTION 88 | 1 89 | -1 90 | EOF 91 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n44-k7.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n44-k6 2 | COMMENT : (Augerat et al, Min no of trucks: 6, Optimal value: 937) 3 | TYPE : CVRP 4 | DIMENSION : 44 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 14 68 9 | 2 73 2 10 | 3 13 47 11 | 4 37 44 12 | 5 34 63 13 | 6 58 98 14 | 7 33 42 15 | 8 18 98 16 | 9 24 79 17 | 10 17 28 18 | 11 72 67 19 | 12 78 63 20 | 13 42 48 21 | 14 1 2 22 | 15 2 28 23 | 16 32 82 24 | 17 97 38 25 | 18 39 53 26 | 19 87 1 27 | 20 42 77 28 | 21 83 27 29 | 22 79 92 30 | 23 22 39 31 | 24 58 32 32 | 25 53 84 33 | 26 38 37 34 | 27 63 59 35 | 28 42 88 36 | 29 32 88 37 | 30 38 23 38 | 31 63 32 39 | 32 22 73 40 | 33 88 94 41 | 34 58 78 42 | 35 43 62 43 | 36 73 1 44 | 37 17 32 45 | 38 87 79 46 | 39 12 24 47 | 40 48 53 48 | 41 48 23 49 | 42 7 37 50 | 43 98 77 51 | 44 34 12 52 | DEMAND_SECTION 53 | 1 0 54 | 2 8 55 | 3 24 56 | 4 9 57 | 5 19 58 | 6 9 59 | 7 18 60 | 8 9 61 | 9 14 62 | 10 3 63 | 11 14 64 | 12 8 65 | 13 8 66 | 14 13 67 | 15 18 68 | 16 4 69 | 17 24 70 | 18 14 71 | 19 8 72 | 20 18 73 | 21 13 74 | 22 2 75 | 23 9 76 | 24 18 77 | 25 3 78 | 26 24 79 | 27 8 80 | 28 24 81 | 29 14 82 | 30 13 83 | 31 24 84 | 32 23 85 | 33 9 86 | 34 13 87 | 35 14 88 | 36 14 89 | 37 18 90 | 38 24 91 | 39 4 92 | 40 8 93 | 41 13 94 | 42 4 95 | 43 14 96 | 44 18 97 | DEPOT_SECTION 98 | 1 99 | -1 100 | EOF 101 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n45-k6.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n45-k6 2 | COMMENT : (Augerat et al, Min no of trucks: 6, Optimal value: 944) 3 | TYPE : CVRP 4 | DIMENSION : 45 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 31 73 9 | 2 11 67 10 | 3 52 96 11 | 4 81 29 12 | 5 97 62 13 | 6 71 5 14 | 7 6 56 15 | 8 48 50 16 | 9 91 17 17 | 10 49 68 18 | 11 85 29 19 | 12 11 16 20 | 13 74 98 21 | 14 56 37 22 | 15 13 81 23 | 16 66 80 24 | 17 96 55 25 | 18 36 17 26 | 19 32 23 27 | 20 6 13 28 | 21 64 30 29 | 22 87 5 30 | 23 75 61 31 | 24 40 72 32 | 25 1 44 33 | 26 60 95 34 | 27 27 49 35 | 28 15 33 36 | 29 46 53 37 | 30 28 43 38 | 31 3 9 39 | 32 1 100 40 | 33 53 46 41 | 34 98 8 42 | 35 6 25 43 | 36 7 81 44 | 37 96 88 45 | 38 2 35 46 | 39 32 94 47 | 40 95 94 48 | 41 9 11 49 | 42 96 16 50 | 43 90 68 51 | 44 33 31 52 | 45 6 59 53 | DEMAND_SECTION 54 | 1 0 55 | 2 19 56 | 3 2 57 | 4 12 58 | 5 20 59 | 6 6 60 | 7 17 61 | 8 8 62 | 9 14 63 | 10 2 64 | 11 8 65 | 12 5 66 | 13 7 67 | 14 22 68 | 15 14 69 | 16 17 70 | 17 23 71 | 18 15 72 | 19 21 73 | 20 2 74 | 21 24 75 | 22 10 76 | 23 20 77 | 24 6 78 | 25 21 79 | 26 10 80 | 27 6 81 | 28 13 82 | 29 21 83 | 30 24 84 | 31 11 85 | 32 16 86 | 33 8 87 | 34 11 88 | 35 11 89 | 36 22 90 | 37 17 91 | 38 22 92 | 39 17 93 | 40 8 94 | 41 23 95 | 42 5 96 | 43 3 97 | 44 18 98 | 45 12 99 | DEPOT_SECTION 100 | 1 101 | -1 102 | EOF 103 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n45-k7.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n45-k7 2 | COMMENT : (Augerat et al, Min no of trucks: 7, Best value: 1146) 3 | TYPE : CVRP 4 | DIMENSION : 45 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 61 99 9 | 2 95 7 10 | 3 45 87 11 | 4 15 47 12 | 5 39 75 13 | 6 55 23 14 | 7 29 71 15 | 8 87 79 16 | 9 75 63 17 | 10 65 61 18 | 11 73 35 19 | 12 17 35 20 | 13 39 99 21 | 14 75 77 22 | 15 49 37 23 | 16 85 31 24 | 17 89 71 25 | 18 89 43 26 | 19 79 81 27 | 20 45 5 28 | 21 93 69 29 | 22 49 69 30 | 23 63 25 31 | 24 93 33 32 | 25 39 45 33 | 26 89 33 34 | 27 47 77 35 | 28 29 19 36 | 29 13 65 37 | 30 33 9 38 | 31 63 9 39 | 32 41 13 40 | 33 67 75 41 | 34 41 27 42 | 35 49 77 43 | 36 57 81 44 | 37 45 5 45 | 38 83 7 46 | 39 81 61 47 | 40 57 81 48 | 41 93 89 49 | 42 17 13 50 | 43 89 27 51 | 44 7 25 52 | 45 35 35 53 | DEMAND_SECTION 54 | 1 0 55 | 2 14 56 | 3 1 57 | 4 16 58 | 5 23 59 | 6 12 60 | 7 6 61 | 8 5 62 | 9 1 63 | 10 13 64 | 11 20 65 | 12 14 66 | 13 18 67 | 14 7 68 | 15 8 69 | 16 21 70 | 17 8 71 | 18 24 72 | 19 20 73 | 20 19 74 | 21 13 75 | 22 3 76 | 23 26 77 | 24 17 78 | 25 22 79 | 26 8 80 | 27 16 81 | 28 20 82 | 29 12 83 | 30 22 84 | 31 20 85 | 32 12 86 | 33 14 87 | 34 25 88 | 35 17 89 | 36 19 90 | 37 20 91 | 38 15 92 | 39 2 93 | 40 9 94 | 41 10 95 | 42 6 96 | 43 11 97 | 44 21 98 | 45 24 99 | DEPOT_SECTION 100 | 1 101 | -1 102 | EOF 103 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n46-k7.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n46-k7 2 | COMMENT : (Augerat et al, Min no of trucks: 7, Optimal value: 914) 3 | TYPE : CVRP 4 | DIMENSION : 46 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 75 55 9 | 2 7 75 10 | 3 77 1 11 | 4 51 25 12 | 5 81 25 13 | 6 59 37 14 | 7 93 45 15 | 8 43 21 16 | 9 35 53 17 | 10 77 63 18 | 11 37 13 19 | 12 37 51 20 | 13 27 31 21 | 14 95 31 22 | 15 87 43 23 | 16 23 65 24 | 17 9 51 25 | 18 73 81 26 | 19 3 1 27 | 20 41 61 28 | 21 29 81 29 | 22 51 95 30 | 23 49 25 31 | 24 81 53 32 | 25 7 51 33 | 26 21 5 34 | 27 91 35 35 | 28 17 81 36 | 29 61 69 37 | 30 27 97 38 | 31 83 23 39 | 32 21 93 40 | 33 59 31 41 | 34 27 53 42 | 35 9 91 43 | 36 11 27 44 | 37 59 41 45 | 38 67 1 46 | 39 77 39 47 | 40 47 29 48 | 41 3 89 49 | 42 33 87 50 | 43 17 45 51 | 44 91 41 52 | 45 23 3 53 | 46 97 61 54 | DEMAND_SECTION 55 | 1 0 56 | 2 12 57 | 3 26 58 | 4 1 59 | 5 20 60 | 6 2 61 | 7 13 62 | 8 20 63 | 9 7 64 | 10 10 65 | 11 15 66 | 12 7 67 | 13 24 68 | 14 10 69 | 15 12 70 | 16 23 71 | 17 13 72 | 18 19 73 | 19 9 74 | 20 12 75 | 21 6 76 | 22 9 77 | 23 22 78 | 24 18 79 | 25 19 80 | 26 20 81 | 27 24 82 | 28 10 83 | 29 4 84 | 30 20 85 | 31 15 86 | 32 13 87 | 33 12 88 | 34 3 89 | 35 7 90 | 36 18 91 | 37 3 92 | 38 23 93 | 39 1 94 | 40 17 95 | 41 13 96 | 42 6 97 | 43 22 98 | 44 20 99 | 45 21 100 | 46 2 101 | DEPOT_SECTION 102 | 1 103 | -1 104 | EOF 105 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n48-k7.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n48-k7 2 | COMMENT : (Augerat et al, Min no of trucks: 7, Best value: 1073) 3 | TYPE : CVRP 4 | DIMENSION : 48 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 47 5 9 | 2 1 19 10 | 3 97 35 11 | 4 23 79 12 | 5 77 87 13 | 6 3 9 14 | 7 5 27 15 | 8 41 53 16 | 9 51 87 17 | 10 67 73 18 | 11 89 45 19 | 12 71 99 20 | 13 11 1 21 | 14 85 85 22 | 15 57 11 23 | 16 57 85 24 | 17 71 33 25 | 18 61 13 26 | 19 39 15 27 | 20 13 59 28 | 21 43 99 29 | 22 87 73 30 | 23 11 37 31 | 24 21 11 32 | 25 77 81 33 | 26 3 63 34 | 27 47 95 35 | 28 53 75 36 | 29 73 55 37 | 30 81 71 38 | 31 89 75 39 | 32 11 9 40 | 33 27 37 41 | 34 95 59 42 | 35 63 63 43 | 36 37 21 44 | 37 33 47 45 | 38 23 63 46 | 39 13 55 47 | 40 47 93 48 | 41 45 43 49 | 42 83 7 50 | 43 69 91 51 | 44 13 11 52 | 45 37 15 53 | 46 53 59 54 | 47 97 83 55 | 48 75 31 56 | DEMAND_SECTION 57 | 1 0 58 | 2 20 59 | 3 14 60 | 4 5 61 | 5 11 62 | 6 22 63 | 7 25 64 | 8 2 65 | 9 18 66 | 10 10 67 | 11 26 68 | 12 14 69 | 13 22 70 | 14 9 71 | 15 11 72 | 16 18 73 | 17 24 74 | 18 15 75 | 19 23 76 | 20 16 77 | 21 14 78 | 22 8 79 | 23 5 80 | 24 12 81 | 25 8 82 | 26 16 83 | 27 12 84 | 28 15 85 | 29 9 86 | 30 2 87 | 31 10 88 | 32 2 89 | 33 3 90 | 34 20 91 | 35 3 92 | 36 13 93 | 37 25 94 | 38 23 95 | 39 8 96 | 40 16 97 | 41 9 98 | 42 14 99 | 43 4 100 | 44 13 101 | 45 7 102 | 46 16 103 | 47 18 104 | 48 16 105 | DEPOT_SECTION 106 | 1 107 | -1 108 | EOF 109 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n53-k7.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n53-k7 2 | COMMENT : (Augerat et al, Min no of trucks: 7, Optimal value: 1010) 3 | TYPE : CVRP 4 | DIMENSION : 53 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 24 63 9 | 2 35 60 10 | 3 79 46 11 | 4 3 45 12 | 5 42 50 13 | 6 3 40 14 | 7 29 96 15 | 8 47 30 16 | 9 54 77 17 | 10 36 30 18 | 11 83 86 19 | 12 30 6 20 | 13 55 29 21 | 14 13 2 22 | 15 1 19 23 | 16 98 1 24 | 17 75 10 25 | 18 39 23 26 | 19 62 91 27 | 20 96 9 28 | 21 27 87 29 | 22 14 16 30 | 23 52 49 31 | 24 95 21 32 | 25 30 6 33 | 26 18 40 34 | 27 82 90 35 | 28 50 79 36 | 29 48 49 37 | 30 82 73 38 | 31 64 62 39 | 32 34 78 40 | 33 83 6 41 | 34 3 77 42 | 35 18 8 43 | 36 53 86 44 | 37 88 51 45 | 38 77 51 46 | 39 58 89 47 | 40 12 44 48 | 41 70 88 49 | 42 36 17 50 | 43 85 23 51 | 44 93 30 52 | 45 68 67 53 | 46 71 34 54 | 47 56 73 55 | 48 37 37 56 | 49 78 20 57 | 50 88 69 58 | 51 95 42 59 | 52 44 71 60 | 53 18 1 61 | DEMAND_SECTION 62 | 1 0 63 | 2 2 64 | 3 12 65 | 4 14 66 | 5 2 67 | 6 17 68 | 7 20 69 | 8 2 70 | 9 26 71 | 10 7 72 | 11 24 73 | 12 23 74 | 13 13 75 | 14 25 76 | 15 20 77 | 16 3 78 | 17 18 79 | 18 23 80 | 19 6 81 | 20 2 82 | 21 13 83 | 22 22 84 | 23 3 85 | 24 6 86 | 25 7 87 | 26 1 88 | 27 18 89 | 28 18 90 | 29 10 91 | 30 2 92 | 31 9 93 | 32 10 94 | 33 8 95 | 34 30 96 | 35 16 97 | 36 23 98 | 37 2 99 | 38 18 100 | 39 22 101 | 40 1 102 | 41 8 103 | 42 4 104 | 43 26 105 | 44 21 106 | 45 2 107 | 46 15 108 | 47 25 109 | 48 22 110 | 49 19 111 | 50 3 112 | 51 3 113 | 52 5 114 | 53 13 115 | DEPOT_SECTION 116 | 1 117 | -1 118 | EOF 119 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n54-k7.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n54-k7 2 | COMMENT : (Augerat et al, Min no of trucks: 7, Best value: 1167) 3 | TYPE : CVRP 4 | DIMENSION : 54 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 61 5 9 | 2 85 53 10 | 3 17 57 11 | 4 49 93 12 | 5 69 11 13 | 6 87 15 14 | 7 49 39 15 | 8 87 23 16 | 9 19 83 17 | 10 69 87 18 | 11 69 43 19 | 12 49 67 20 | 13 17 61 21 | 14 45 61 22 | 15 21 53 23 | 16 71 37 24 | 17 53 23 25 | 18 77 63 26 | 19 89 7 27 | 20 21 83 28 | 21 77 25 29 | 22 85 95 30 | 23 43 93 31 | 24 75 25 32 | 25 1 43 33 | 26 7 7 34 | 27 81 69 35 | 28 23 57 36 | 29 81 15 37 | 30 77 35 38 | 31 49 3 39 | 32 21 93 40 | 33 41 37 41 | 34 71 91 42 | 35 31 13 43 | 36 69 33 44 | 37 91 47 45 | 38 13 69 46 | 39 65 75 47 | 40 91 27 48 | 41 9 85 49 | 42 15 19 50 | 43 7 37 51 | 44 61 11 52 | 45 59 83 53 | 46 85 69 54 | 47 15 29 55 | 48 1 13 56 | 49 1 83 57 | 50 85 31 58 | 51 95 25 59 | 52 5 33 60 | 53 51 11 61 | 54 51 85 62 | DEMAND_SECTION 63 | 1 0 64 | 2 24 65 | 3 9 66 | 4 15 67 | 5 17 68 | 6 2 69 | 7 19 70 | 8 10 71 | 9 17 72 | 10 20 73 | 11 16 74 | 12 8 75 | 13 12 76 | 14 3 77 | 15 23 78 | 16 4 79 | 17 23 80 | 18 20 81 | 19 2 82 | 20 19 83 | 21 2 84 | 22 23 85 | 23 23 86 | 24 5 87 | 25 12 88 | 26 15 89 | 27 9 90 | 28 13 91 | 29 18 92 | 30 16 93 | 31 7 94 | 32 6 95 | 33 2 96 | 34 8 97 | 35 2 98 | 36 2 99 | 37 4 100 | 38 13 101 | 39 18 102 | 40 9 103 | 41 19 104 | 42 3 105 | 43 14 106 | 44 19 107 | 45 21 108 | 46 4 109 | 47 6 110 | 48 22 111 | 49 13 112 | 50 10 113 | 51 18 114 | 52 5 115 | 53 9 116 | 54 36 117 | DEPOT_SECTION 118 | 1 119 | -1 120 | EOF 121 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n55-k9.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n55-k9 2 | COMMENT : (Augerat et al, Min no of trucks: 9, Optimal value: 1073) 3 | TYPE : CVRP 4 | DIMENSION : 55 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 36 64 9 | 2 94 47 10 | 3 10 23 11 | 4 16 46 12 | 5 25 79 13 | 6 41 30 14 | 7 81 45 15 | 8 14 79 16 | 9 42 56 17 | 10 90 17 18 | 11 41 39 19 | 12 21 14 20 | 13 41 46 21 | 14 65 96 22 | 15 13 49 23 | 16 21 14 24 | 17 57 2 25 | 18 14 42 26 | 19 66 62 27 | 20 58 96 28 | 21 5 51 29 | 22 41 50 30 | 23 50 99 31 | 24 84 85 32 | 25 97 90 33 | 26 47 76 34 | 27 11 54 35 | 28 60 97 36 | 29 60 89 37 | 30 58 68 38 | 31 30 93 39 | 32 9 60 40 | 33 47 44 41 | 34 19 40 42 | 35 15 40 43 | 36 88 21 44 | 37 33 58 45 | 38 21 51 46 | 39 57 7 47 | 40 81 6 48 | 41 49 6 49 | 42 51 78 50 | 43 9 62 51 | 44 84 36 52 | 45 95 76 53 | 46 89 44 54 | 47 10 49 55 | 48 69 16 56 | 49 75 66 57 | 50 97 11 58 | 51 74 69 59 | 52 1 14 60 | 53 96 91 61 | 54 46 22 62 | 55 74 92 63 | DEMAND_SECTION 64 | 1 0 65 | 2 3 66 | 3 12 67 | 4 25 68 | 5 4 69 | 6 11 70 | 7 20 71 | 8 21 72 | 9 10 73 | 10 20 74 | 11 13 75 | 12 14 76 | 13 16 77 | 14 17 78 | 15 11 79 | 16 36 80 | 17 6 81 | 18 7 82 | 19 21 83 | 20 11 84 | 21 17 85 | 22 22 86 | 23 10 87 | 24 19 88 | 25 21 89 | 26 23 90 | 27 19 91 | 28 15 92 | 29 22 93 | 30 7 94 | 31 11 95 | 32 15 96 | 33 22 97 | 34 12 98 | 35 24 99 | 36 25 100 | 37 2 101 | 38 15 102 | 39 18 103 | 40 13 104 | 41 3 105 | 42 20 106 | 43 14 107 | 44 10 108 | 45 10 109 | 46 66 110 | 47 10 111 | 48 7 112 | 49 12 113 | 50 24 114 | 51 5 115 | 52 18 116 | 53 7 117 | 54 11 118 | 55 12 119 | DEPOT_SECTION 120 | 1 121 | -1 122 | EOF 123 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n60-k9.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n60-k9 2 | COMMENT : (Augerat et al, Min no of trucks: 9, Best value: 1408) 3 | TYPE : CVRP 4 | DIMENSION : 60 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 27 93 9 | 2 33 27 10 | 3 29 39 11 | 4 7 81 12 | 5 1 59 13 | 6 49 9 14 | 7 21 53 15 | 8 79 89 16 | 9 81 83 17 | 10 85 11 18 | 11 45 9 19 | 12 7 65 20 | 13 95 27 21 | 14 81 85 22 | 15 37 81 23 | 16 69 69 24 | 17 15 95 25 | 18 89 75 26 | 19 33 93 27 | 20 57 83 28 | 21 11 95 29 | 22 3 57 30 | 23 45 11 31 | 24 43 61 32 | 25 35 43 33 | 26 19 83 34 | 27 83 69 35 | 28 85 77 36 | 29 19 39 37 | 30 83 87 38 | 31 1 13 39 | 32 15 39 40 | 33 83 17 41 | 34 41 97 42 | 35 31 61 43 | 36 59 69 44 | 37 29 15 45 | 38 93 83 46 | 39 63 97 47 | 40 65 57 48 | 41 15 69 49 | 42 31 97 50 | 43 57 9 51 | 44 85 37 52 | 45 21 29 53 | 46 53 11 54 | 47 15 77 55 | 48 41 69 56 | 49 45 17 57 | 50 13 25 58 | 51 63 57 59 | 52 95 5 60 | 53 55 91 61 | 54 3 31 62 | 55 47 7 63 | 56 61 69 64 | 57 85 35 65 | 58 89 81 66 | 59 45 47 67 | 60 65 93 68 | DEMAND_SECTION 69 | 1 0 70 | 2 16 71 | 3 2 72 | 4 7 73 | 5 11 74 | 6 9 75 | 7 17 76 | 8 21 77 | 9 23 78 | 10 10 79 | 11 6 80 | 12 19 81 | 13 18 82 | 14 20 83 | 15 13 84 | 16 5 85 | 17 11 86 | 18 24 87 | 19 2 88 | 20 3 89 | 21 1 90 | 22 5 91 | 23 20 92 | 24 23 93 | 25 24 94 | 26 18 95 | 27 19 96 | 28 2 97 | 29 17 98 | 30 17 99 | 31 9 100 | 32 11 101 | 33 2 102 | 34 6 103 | 35 9 104 | 36 5 105 | 37 9 106 | 38 2 107 | 39 14 108 | 40 19 109 | 41 11 110 | 42 21 111 | 43 20 112 | 44 21 113 | 45 18 114 | 46 48 115 | 47 1 116 | 48 17 117 | 49 42 118 | 50 2 119 | 51 4 120 | 52 24 121 | 53 18 122 | 54 21 123 | 55 11 124 | 56 9 125 | 57 18 126 | 58 22 127 | 59 9 128 | 60 23 129 | DEPOT_SECTION 130 | 1 131 | -1 132 | EOF 133 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n61-k9.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n61-k9 2 | COMMENT : (Augerat et al, Min no of trucks: 9, Best value: 1035) 3 | TYPE : CVRP 4 | DIMENSION : 61 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 61 37 9 | 2 93 57 10 | 3 15 67 11 | 4 23 43 12 | 5 53 5 13 | 6 13 75 14 | 7 29 73 15 | 8 47 37 16 | 9 23 71 17 | 10 67 45 18 | 11 21 49 19 | 12 93 43 20 | 13 67 13 21 | 14 69 25 22 | 15 53 35 23 | 16 25 39 24 | 17 85 69 25 | 18 81 27 26 | 19 77 79 27 | 20 45 43 28 | 21 31 75 29 | 22 49 99 30 | 23 63 9 31 | 24 47 37 32 | 25 33 47 33 | 26 39 69 34 | 27 49 3 35 | 28 49 87 36 | 29 87 39 37 | 30 37 91 38 | 31 19 33 39 | 32 97 35 40 | 33 31 5 41 | 34 35 25 42 | 35 79 61 43 | 36 73 73 44 | 37 35 95 45 | 38 5 43 46 | 39 19 45 47 | 40 71 39 48 | 41 35 63 49 | 42 27 73 50 | 43 31 21 51 | 44 47 9 52 | 45 87 45 53 | 46 1 49 54 | 47 1 77 55 | 48 63 73 56 | 49 79 71 57 | 50 21 55 58 | 51 65 23 59 | 52 65 47 60 | 53 97 23 61 | 54 23 71 62 | 55 5 81 63 | 56 53 27 64 | 57 57 85 65 | 58 89 23 66 | 59 51 65 67 | 60 13 49 68 | 61 91 41 69 | DEMAND_SECTION 70 | 1 0 71 | 2 23 72 | 3 17 73 | 4 12 74 | 5 6 75 | 6 22 76 | 7 3 77 | 8 24 78 | 9 24 79 | 10 11 80 | 11 7 81 | 12 12 82 | 13 8 83 | 14 14 84 | 15 20 85 | 16 16 86 | 17 16 87 | 18 4 88 | 19 9 89 | 20 18 90 | 21 14 91 | 22 10 92 | 23 19 93 | 24 22 94 | 25 19 95 | 26 9 96 | 27 18 97 | 28 2 98 | 29 18 99 | 30 11 100 | 31 19 101 | 32 18 102 | 33 15 103 | 34 4 104 | 35 12 105 | 36 8 106 | 37 18 107 | 38 12 108 | 39 72 109 | 40 2 110 | 41 5 111 | 42 14 112 | 43 11 113 | 44 19 114 | 45 16 115 | 46 19 116 | 47 3 117 | 48 12 118 | 49 10 119 | 50 20 120 | 51 7 121 | 52 13 122 | 53 16 123 | 54 23 124 | 55 22 125 | 56 18 126 | 57 6 127 | 58 12 128 | 59 27 129 | 60 9 130 | 61 15 131 | DEPOT_SECTION 132 | 1 133 | -1 134 | EOF 135 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n62-k8.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n62-k8 2 | COMMENT : (Augerat et al, Min no of trucks: 8, Best value: 1290) 3 | TYPE : CVRP 4 | DIMENSION : 62 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 2 48 9 | 2 64 71 10 | 3 33 83 11 | 4 77 89 12 | 5 96 61 13 | 6 53 55 14 | 7 38 10 15 | 8 7 40 16 | 9 7 1 17 | 10 73 68 18 | 11 4 24 19 | 12 82 56 20 | 13 30 56 21 | 14 38 62 22 | 15 42 53 23 | 16 5 49 24 | 17 1 85 25 | 18 94 4 26 | 19 50 70 27 | 20 35 69 28 | 21 14 41 29 | 22 94 73 30 | 23 23 96 31 | 24 96 88 32 | 25 74 94 33 | 26 68 52 34 | 27 73 22 35 | 28 92 96 36 | 29 4 48 37 | 30 24 10 38 | 31 52 72 39 | 32 61 46 40 | 33 38 9 41 | 34 90 15 42 | 35 58 41 43 | 36 93 41 44 | 37 8 74 45 | 38 13 87 46 | 39 34 68 47 | 40 84 97 48 | 41 35 20 49 | 42 96 79 50 | 43 73 87 51 | 44 21 1 52 | 45 28 93 53 | 46 55 94 54 | 47 56 84 55 | 48 68 99 56 | 49 30 53 57 | 50 85 49 58 | 51 85 2 59 | 52 0 30 60 | 53 12 71 61 | 54 26 55 62 | 55 72 75 63 | 56 71 21 64 | 57 33 49 65 | 58 51 2 66 | 59 93 7 67 | 60 70 22 68 | 61 54 53 69 | 62 26 17 70 | DEMAND_SECTION 71 | 1 0 72 | 2 26 73 | 3 18 74 | 4 16 75 | 5 8 76 | 6 7 77 | 7 11 78 | 8 4 79 | 9 9 80 | 10 9 81 | 11 16 82 | 12 7 83 | 13 6 84 | 14 1 85 | 15 2 86 | 16 22 87 | 17 23 88 | 18 4 89 | 19 3 90 | 20 20 91 | 21 7 92 | 22 1 93 | 23 2 94 | 24 12 95 | 25 22 96 | 26 6 97 | 27 11 98 | 28 12 99 | 29 2 100 | 30 14 101 | 31 14 102 | 32 2 103 | 33 9 104 | 34 20 105 | 35 2 106 | 36 18 107 | 37 19 108 | 38 18 109 | 39 4 110 | 40 16 111 | 41 26 112 | 42 3 113 | 43 23 114 | 44 16 115 | 45 10 116 | 46 9 117 | 47 21 118 | 48 24 119 | 49 24 120 | 50 19 121 | 51 12 122 | 52 16 123 | 53 6 124 | 54 2 125 | 55 2 126 | 56 2 127 | 57 23 128 | 58 16 129 | 59 26 130 | 60 21 131 | 61 2 132 | 62 7 133 | DEPOT_SECTION 134 | 1 135 | -1 136 | EOF 137 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n63-k10.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n63-k10 2 | COMMENT : (Augerat et al, Min no of trucks: 10, Best value: 1315) 3 | TYPE : CVRP 4 | DIMENSION : 63 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 76 75 9 | 2 60 14 10 | 3 46 5 11 | 4 91 14 12 | 5 70 95 13 | 6 86 31 14 | 7 20 0 15 | 8 41 55 16 | 9 21 15 17 | 10 46 1 18 | 11 95 45 19 | 12 16 89 20 | 13 41 1 21 | 14 60 94 22 | 15 55 25 23 | 16 71 41 24 | 17 39 35 25 | 18 61 70 26 | 19 80 36 27 | 20 100 26 28 | 21 65 85 29 | 22 40 51 30 | 23 19 71 31 | 24 34 50 32 | 25 36 61 33 | 26 69 50 34 | 27 61 94 35 | 28 19 11 36 | 29 51 91 37 | 30 61 54 38 | 31 76 90 39 | 32 41 75 40 | 33 35 100 41 | 34 1 40 42 | 35 15 91 43 | 36 21 11 44 | 37 79 81 45 | 38 34 36 46 | 39 74 99 47 | 40 75 14 48 | 41 65 54 49 | 42 55 10 50 | 43 100 6 51 | 44 99 91 52 | 45 25 86 53 | 46 75 16 54 | 47 30 45 55 | 48 21 85 56 | 49 75 80 57 | 50 71 35 58 | 51 56 81 59 | 52 25 76 60 | 53 85 76 61 | 54 60 34 62 | 55 41 44 63 | 56 6 55 64 | 57 60 54 65 | 58 40 96 66 | 59 20 71 67 | 60 94 45 68 | 61 31 41 69 | 62 40 49 70 | 63 56 80 71 | DEMAND_SECTION 72 | 1 0 73 | 2 11 74 | 3 20 75 | 4 26 76 | 5 17 77 | 6 5 78 | 7 17 79 | 8 1 80 | 9 15 81 | 10 16 82 | 11 22 83 | 12 2 84 | 13 22 85 | 14 25 86 | 15 20 87 | 16 20 88 | 17 21 89 | 18 26 90 | 19 12 91 | 20 5 92 | 21 11 93 | 22 5 94 | 23 21 95 | 24 17 96 | 25 12 97 | 26 12 98 | 27 15 99 | 28 21 100 | 29 12 101 | 30 2 102 | 31 17 103 | 32 16 104 | 33 15 105 | 34 26 106 | 35 12 107 | 36 22 108 | 37 16 109 | 38 21 110 | 39 16 111 | 40 2 112 | 41 6 113 | 42 2 114 | 43 6 115 | 44 10 116 | 45 11 117 | 46 1 118 | 47 63 119 | 48 10 120 | 49 21 121 | 50 7 122 | 51 1 123 | 52 6 124 | 53 26 125 | 54 17 126 | 55 10 127 | 56 25 128 | 57 25 129 | 58 25 130 | 59 16 131 | 60 5 132 | 61 22 133 | 62 17 134 | 63 6 135 | DEPOT_SECTION 136 | 1 137 | -1 138 | EOF 139 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n63-k9.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n63-k9 2 | COMMENT : (Augerat et al, Min no of trucks: 9, Best value: 1634) 3 | TYPE : CVRP 4 | DIMENSION : 63 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 91 93 9 | 2 7 5 10 | 3 27 91 11 | 4 21 47 12 | 5 33 11 13 | 6 19 99 14 | 7 59 25 15 | 8 69 79 16 | 9 11 73 17 | 10 21 35 18 | 11 59 45 19 | 12 99 81 20 | 13 71 47 21 | 14 53 83 22 | 15 87 1 23 | 16 79 67 24 | 17 59 65 25 | 18 67 21 26 | 19 27 1 27 | 20 81 93 28 | 21 59 89 29 | 22 95 23 30 | 23 73 25 31 | 24 41 25 32 | 25 3 65 33 | 26 59 83 34 | 27 83 97 35 | 28 5 83 36 | 29 71 35 37 | 30 37 97 38 | 31 29 93 39 | 32 19 21 40 | 33 83 13 41 | 34 97 67 42 | 35 31 83 43 | 36 65 17 44 | 37 19 63 45 | 38 59 23 46 | 39 17 25 47 | 40 45 27 48 | 41 89 7 49 | 42 19 41 50 | 43 23 39 51 | 44 23 21 52 | 45 83 61 53 | 46 11 93 54 | 47 17 11 55 | 48 35 11 56 | 49 21 59 57 | 50 21 69 58 | 51 71 13 59 | 52 63 13 60 | 53 49 21 61 | 54 83 31 62 | 55 41 97 63 | 56 85 15 64 | 57 77 73 65 | 58 57 1 66 | 59 83 11 67 | 60 1 75 68 | 61 45 71 69 | 62 41 55 70 | 63 45 13 71 | DEMAND_SECTION 72 | 1 0 73 | 2 4 74 | 3 18 75 | 4 22 76 | 5 14 77 | 6 5 78 | 7 9 79 | 8 7 80 | 9 20 81 | 10 19 82 | 11 7 83 | 12 18 84 | 13 20 85 | 14 2 86 | 15 11 87 | 16 10 88 | 17 5 89 | 18 21 90 | 19 20 91 | 20 1 92 | 21 15 93 | 22 15 94 | 23 14 95 | 24 19 96 | 25 22 97 | 26 21 98 | 27 22 99 | 28 6 100 | 29 24 101 | 30 14 102 | 31 14 103 | 32 2 104 | 33 15 105 | 34 21 106 | 35 15 107 | 36 6 108 | 37 23 109 | 38 14 110 | 39 26 111 | 40 15 112 | 41 15 113 | 42 23 114 | 43 7 115 | 44 22 116 | 45 26 117 | 46 20 118 | 47 3 119 | 48 2 120 | 49 15 121 | 50 2 122 | 51 21 123 | 52 12 124 | 53 4 125 | 54 10 126 | 55 23 127 | 56 4 128 | 57 24 129 | 58 17 130 | 59 2 131 | 60 20 132 | 61 18 133 | 62 19 134 | 63 8 135 | DEPOT_SECTION 136 | 1 137 | -1 138 | EOF 139 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n64-k9.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n64-k9 2 | COMMENT : (Augerat et al, Min no of trucks: 9, Best value: 1402) 3 | TYPE : CVRP 4 | DIMENSION : 64 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 97 33 9 | 2 57 81 10 | 3 1 33 11 | 4 55 57 12 | 5 29 37 13 | 6 21 39 14 | 7 93 37 15 | 8 5 91 16 | 9 25 11 17 | 10 47 37 18 | 11 87 25 19 | 12 67 65 20 | 13 71 89 21 | 14 67 15 22 | 15 45 79 23 | 16 71 57 24 | 17 29 1 25 | 18 59 79 26 | 19 93 83 27 | 20 47 41 28 | 21 51 41 29 | 22 23 93 30 | 23 87 95 31 | 24 39 45 32 | 25 45 7 33 | 26 85 51 34 | 27 35 93 35 | 28 47 79 36 | 29 59 91 37 | 30 83 51 38 | 31 49 65 39 | 32 21 55 40 | 33 51 21 41 | 34 69 43 42 | 35 37 41 43 | 36 37 95 44 | 37 5 71 45 | 38 37 47 46 | 39 83 73 47 | 40 17 71 48 | 41 5 71 49 | 42 81 17 50 | 43 59 33 51 | 44 63 87 52 | 45 21 77 53 | 46 71 51 54 | 47 21 17 55 | 48 9 7 56 | 49 65 43 57 | 50 25 63 58 | 51 13 57 59 | 52 47 43 60 | 53 77 9 61 | 54 57 55 62 | 55 21 33 63 | 56 27 59 64 | 57 83 9 65 | 58 63 69 66 | 59 9 35 67 | 60 25 55 68 | 61 33 3 69 | 62 53 11 70 | 63 51 49 71 | 64 9 23 72 | DEMAND_SECTION 73 | 1 0 74 | 2 10 75 | 3 15 76 | 4 23 77 | 5 23 78 | 6 24 79 | 7 17 80 | 8 1 81 | 9 4 82 | 10 2 83 | 11 5 84 | 12 18 85 | 13 9 86 | 14 8 87 | 15 23 88 | 16 13 89 | 17 4 90 | 18 18 91 | 19 16 92 | 20 26 93 | 21 16 94 | 22 4 95 | 23 23 96 | 24 8 97 | 25 26 98 | 26 16 99 | 27 5 100 | 28 2 101 | 29 21 102 | 30 23 103 | 31 8 104 | 32 5 105 | 33 8 106 | 34 26 107 | 35 12 108 | 36 8 109 | 37 3 110 | 38 8 111 | 39 19 112 | 40 16 113 | 41 2 114 | 42 3 115 | 43 17 116 | 44 7 117 | 45 5 118 | 46 8 119 | 47 4 120 | 48 12 121 | 49 19 122 | 50 19 123 | 51 26 124 | 52 24 125 | 53 5 126 | 54 8 127 | 55 22 128 | 56 9 129 | 57 18 130 | 58 19 131 | 59 15 132 | 60 5 133 | 61 11 134 | 62 12 135 | 63 54 136 | 64 8 137 | DEPOT_SECTION 138 | 1 139 | -1 140 | EOF 141 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n65-k9.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n65-k9 2 | COMMENT : (Augerat et al, Min no of trucks: 9, Best value: 1177) 3 | TYPE : CVRP 4 | DIMENSION : 65 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 25 51 9 | 2 35 7 10 | 3 93 75 11 | 4 53 95 12 | 5 51 81 13 | 6 51 55 14 | 7 1 67 15 | 8 9 23 16 | 9 75 7 17 | 10 15 97 18 | 11 79 5 19 | 12 9 19 20 | 13 39 1 21 | 14 47 1 22 | 15 33 97 23 | 16 27 83 24 | 17 83 79 25 | 18 17 59 26 | 19 47 19 27 | 20 57 9 28 | 21 87 41 29 | 22 55 25 30 | 23 21 91 31 | 24 21 13 32 | 25 67 1 33 | 26 59 21 34 | 27 1 75 35 | 28 33 85 36 | 29 25 21 37 | 30 45 29 38 | 31 63 77 39 | 32 1 77 40 | 33 77 41 41 | 34 35 11 42 | 35 9 77 43 | 36 61 87 44 | 37 59 91 45 | 38 63 79 46 | 39 97 67 47 | 40 9 45 48 | 41 93 21 49 | 42 83 71 50 | 43 95 57 51 | 44 31 69 52 | 45 77 17 53 | 46 63 57 54 | 47 3 63 55 | 48 11 69 56 | 49 7 9 57 | 50 37 65 58 | 51 75 83 59 | 52 15 53 60 | 53 69 5 61 | 54 69 27 62 | 55 5 19 63 | 56 49 31 64 | 57 77 17 65 | 58 15 7 66 | 59 91 39 67 | 60 79 17 68 | 61 67 75 69 | 62 93 51 70 | 63 25 33 71 | 64 9 19 72 | 65 3 65 73 | DEMAND_SECTION 74 | 1 0 75 | 2 12 76 | 3 24 77 | 4 16 78 | 5 7 79 | 6 9 80 | 7 20 81 | 8 10 82 | 9 18 83 | 10 26 84 | 11 17 85 | 12 2 86 | 13 11 87 | 14 9 88 | 15 12 89 | 16 11 90 | 17 12 91 | 18 23 92 | 19 7 93 | 20 1 94 | 21 26 95 | 22 10 96 | 23 9 97 | 24 22 98 | 25 21 99 | 26 17 100 | 27 2 101 | 28 15 102 | 29 16 103 | 30 14 104 | 31 23 105 | 32 24 106 | 33 2 107 | 34 12 108 | 35 18 109 | 36 5 110 | 37 19 111 | 38 15 112 | 39 8 113 | 40 6 114 | 41 14 115 | 42 13 116 | 43 5 117 | 44 24 118 | 45 25 119 | 46 2 120 | 47 8 121 | 48 14 122 | 49 2 123 | 50 13 124 | 51 10 125 | 52 6 126 | 53 6 127 | 54 24 128 | 55 21 129 | 56 20 130 | 57 24 131 | 58 4 132 | 59 19 133 | 60 14 134 | 61 23 135 | 62 2 136 | 63 16 137 | 64 23 138 | 65 14 139 | DEPOT_SECTION 140 | 1 141 | -1 142 | EOF 143 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n69-k9.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n69-k9 2 | COMMENT : (Augerat et al, Min no of trucks: 9, Best value: 1168) 3 | TYPE : CVRP 4 | DIMENSION : 69 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 59 44 9 | 2 9 23 10 | 3 84 68 11 | 4 36 93 12 | 5 87 9 13 | 6 34 16 14 | 7 40 98 15 | 8 72 43 16 | 9 0 60 17 | 10 64 90 18 | 11 11 8 19 | 12 46 7 20 | 13 33 54 21 | 14 23 84 22 | 15 67 18 23 | 16 34 93 24 | 17 19 25 25 | 18 14 9 26 | 19 70 64 27 | 20 58 50 28 | 21 5 78 29 | 22 95 39 30 | 23 38 54 31 | 24 50 73 32 | 25 48 46 33 | 26 64 4 34 | 27 39 28 35 | 28 79 30 36 | 29 61 36 37 | 30 28 50 38 | 31 51 91 39 | 32 68 59 40 | 33 14 9 41 | 34 94 87 42 | 35 68 29 43 | 36 12 91 44 | 37 2 22 45 | 38 25 16 46 | 39 11 57 47 | 40 3 51 48 | 41 13 52 49 | 42 9 76 50 | 43 58 18 51 | 44 40 39 52 | 45 32 89 53 | 46 9 92 54 | 47 36 14 55 | 48 82 13 56 | 49 10 25 57 | 50 96 97 58 | 51 20 21 59 | 52 40 91 60 | 53 33 31 61 | 54 72 74 62 | 55 41 24 63 | 56 90 20 64 | 57 4 44 65 | 58 54 22 66 | 59 43 59 67 | 60 3 70 68 | 61 94 16 69 | 62 94 54 70 | 63 14 40 71 | 64 37 0 72 | 65 88 55 73 | 66 80 25 74 | 67 37 64 75 | 68 87 47 76 | 69 18 68 77 | DEMAND_SECTION 78 | 1 0 79 | 2 2 80 | 3 1 81 | 4 6 82 | 5 9 83 | 6 16 84 | 7 5 85 | 8 3 86 | 9 9 87 | 10 12 88 | 11 1 89 | 12 1 90 | 13 18 91 | 14 10 92 | 15 5 93 | 16 5 94 | 17 9 95 | 18 16 96 | 19 12 97 | 20 6 98 | 21 6 99 | 22 20 100 | 23 23 101 | 24 39 102 | 25 17 103 | 26 8 104 | 27 2 105 | 28 13 106 | 29 17 107 | 30 3 108 | 31 2 109 | 32 7 110 | 33 23 111 | 34 10 112 | 35 7 113 | 36 12 114 | 37 20 115 | 38 13 116 | 39 21 117 | 40 25 118 | 41 5 119 | 42 4 120 | 43 13 121 | 44 12 122 | 45 23 123 | 46 19 124 | 47 10 125 | 48 7 126 | 49 15 127 | 50 5 128 | 51 15 129 | 52 13 130 | 53 30 131 | 54 15 132 | 55 7 133 | 56 9 134 | 57 23 135 | 58 8 136 | 59 5 137 | 60 8 138 | 61 25 139 | 62 12 140 | 63 25 141 | 64 24 142 | 65 8 143 | 66 22 144 | 67 7 145 | 68 24 146 | 69 18 147 | DEPOT_SECTION 148 | 1 149 | -1 150 | EOF 151 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/A-n80-k10.vrp: -------------------------------------------------------------------------------- 1 | NAME : A-n80-k10 2 | COMMENT : (Augerat et al, Min no of trucks: 10, Best value: 1764) 3 | TYPE : CVRP 4 | DIMENSION : 80 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 92 92 9 | 2 88 58 10 | 3 70 6 11 | 4 57 59 12 | 5 0 98 13 | 6 61 38 14 | 7 65 22 15 | 8 91 52 16 | 9 59 2 17 | 10 3 54 18 | 11 95 38 19 | 12 80 28 20 | 13 66 42 21 | 14 79 74 22 | 15 99 25 23 | 16 20 43 24 | 17 40 3 25 | 18 50 42 26 | 19 97 0 27 | 20 21 19 28 | 21 36 21 29 | 22 100 61 30 | 23 11 85 31 | 24 69 35 32 | 25 69 22 33 | 26 29 35 34 | 27 14 9 35 | 28 50 33 36 | 29 89 17 37 | 30 57 44 38 | 31 60 25 39 | 32 48 42 40 | 33 17 93 41 | 34 21 50 42 | 35 77 18 43 | 36 2 4 44 | 37 63 83 45 | 38 68 6 46 | 39 41 95 47 | 40 48 54 48 | 41 98 73 49 | 42 26 38 50 | 43 69 76 51 | 44 40 1 52 | 45 65 41 53 | 46 14 86 54 | 47 32 39 55 | 48 14 24 56 | 49 96 5 57 | 50 82 98 58 | 51 23 85 59 | 52 63 69 60 | 53 87 19 61 | 54 56 75 62 | 55 15 63 63 | 56 10 45 64 | 57 7 30 65 | 58 31 11 66 | 59 36 93 67 | 60 50 31 68 | 61 49 52 69 | 62 39 10 70 | 63 76 40 71 | 64 83 34 72 | 65 33 51 73 | 66 0 15 74 | 67 52 82 75 | 68 52 82 76 | 69 46 6 77 | 70 3 26 78 | 71 46 80 79 | 72 94 30 80 | 73 26 76 81 | 74 75 92 82 | 75 57 51 83 | 76 34 21 84 | 77 28 80 85 | 78 59 66 86 | 79 51 16 87 | 80 87 11 88 | DEMAND_SECTION 89 | 1 0 90 | 2 24 91 | 3 22 92 | 4 23 93 | 5 5 94 | 6 11 95 | 7 23 96 | 8 26 97 | 9 9 98 | 10 23 99 | 11 9 100 | 12 14 101 | 13 16 102 | 14 12 103 | 15 2 104 | 16 2 105 | 17 6 106 | 18 20 107 | 19 26 108 | 20 12 109 | 21 15 110 | 22 13 111 | 23 26 112 | 24 17 113 | 25 7 114 | 26 12 115 | 27 4 116 | 28 4 117 | 29 20 118 | 30 10 119 | 31 9 120 | 32 2 121 | 33 9 122 | 34 1 123 | 35 2 124 | 36 2 125 | 37 12 126 | 38 14 127 | 39 23 128 | 40 21 129 | 41 13 130 | 42 13 131 | 43 23 132 | 44 3 133 | 45 6 134 | 46 23 135 | 47 11 136 | 48 2 137 | 49 7 138 | 50 13 139 | 51 10 140 | 52 3 141 | 53 6 142 | 54 13 143 | 55 2 144 | 56 14 145 | 57 7 146 | 58 21 147 | 59 7 148 | 60 22 149 | 61 13 150 | 62 22 151 | 63 18 152 | 64 22 153 | 65 6 154 | 66 2 155 | 67 11 156 | 68 5 157 | 69 9 158 | 70 9 159 | 71 5 160 | 72 12 161 | 73 2 162 | 74 12 163 | 75 19 164 | 76 6 165 | 77 14 166 | 78 2 167 | 79 2 168 | 80 24 169 | DEPOT_SECTION 170 | 1 171 | -1 172 | EOF 173 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/F-n135-k7.vrp: -------------------------------------------------------------------------------- 1 | NAME : F-n135-k7 2 | COMMENT : (Fisher: problem 12, Min no of trucks: 7, Best value: 1165) 3 | TYPE : CVRP 4 | DIMENSION : 135 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 2210 7 | NODE_COORD_SECTION 8 | 1 -6.0 15.0 9 | 2 3.2 5.1 10 | 3 24.6 8.3 11 | 4 23.3 1.3 12 | 5 27.8 8.3 13 | 6 29.0 8.0 14 | 7 31.0 8.0 15 | 8 33.5 10.5 16 | 9 30.0 10.5 17 | 10 29.0 10.0 18 | 11 26.5 11.7 19 | 12 28.3 14.3 20 | 13 27.0 14.3 21 | 14 23.5 19.0 22 | 15 26.0 20.0 23 | 16 25.0 20.0 24 | 17 20.5 19.0 25 | 18 -20.0 13.0 26 | 19 -21.0 14.0 27 | 20 -30.0 30.0 28 | 21 -5.0 30.0 29 | 22 1.3 17.8 30 | 23 1.8 13.8 31 | 24 1.8 13.1 32 | 25 2.0 13.6 33 | 26 4.8 17.0 34 | 27 7.0 15.0 35 | 28 9.8 16.6 36 | 29 11.4 14.5 37 | 30 14.4 11.3 38 | 31 11.0 12.0 39 | 32 9.3 10.7 40 | 33 0.6 2.8 41 | 34 -30.0 -10.0 42 | 35 2.0 0.0 43 | 36 14.5 1.0 44 | 37 15.0 1.8 45 | 38 17.2 2.4 46 | 39 17.2 4.2 47 | 40 18.2 4.4 48 | 41 20.3 2.1 49 | 42 22.8 3.1 50 | 43 23.0 4.0 51 | 44 20.8 4.0 52 | 45 20.8 4.0 53 | 46 18.5 6.4 54 | 47 -14.0 16.0 55 | 48 -0.5 6.9 56 | 49 3.2 2.8 57 | 50 5.6 1.8 58 | 51 8.7 2.8 59 | 52 9.0 3.3 60 | 53 9.0 3.5 61 | 54 11.2 3.3 62 | 55 10.8 4.7 63 | 56 11.5 4.6 64 | 57 12.3 4.7 65 | 58 12.3 5.5 66 | 59 11.2 6.9 67 | 60 6.5 9.7 68 | 61 5.8 8.5 69 | 62 7.2 6.0 70 | 63 7.2 4.0 71 | 64 -4.0 -4.0 72 | 65 -3.0 1.2 73 | 66 -40.0 49.0 74 | 67 -15.0 10.0 75 | 68 -11.0 -10.0 76 | 69 -25.0 -20.0 77 | 70 -25.0 -35.0 78 | 71 -24.0 -35.0 79 | 72 -18.0 10.0 80 | 73 -2.0 10.0 81 | 74 -4.0 8.0 82 | 75 -3.0 5.0 83 | 76 2.1 6.2 84 | 77 -1.7 3.0 85 | 78 -3.0 2.0 86 | 79 -7.0 0.0 87 | 80 -3.0 -6.0 88 | 81 -30.0 -11.0 89 | 82 -62.0 -10.0 90 | 83 -8.0 30.0 91 | 84 1.0 60.0 92 | 85 10.0 52.0 93 | 86 10.0 52.0 94 | 87 10.0 51.0 95 | 88 16.0 29.0 96 | 89 26.0 21.0 97 | 90 16.0 21.0 98 | 91 15.5 19.2 99 | 92 0.0 16.5 100 | 93 17.2 14.3 101 | 94 16.5 7.8 102 | 95 16.9 7.7 103 | 96 18.0 2.0 104 | 97 16.2 4.0 105 | 98 15.0 4.0 106 | 99 15.0 3.0 107 | 100 14.8 2.4 108 | 101 14.5 3.0 109 | 102 13.0 2.6 110 | 103 11.8 3.0 111 | 104 12.0 4.0 112 | 105 12.8 3.6 113 | 106 13.4 5.5 114 | 107 -150.0 8.0 115 | 108 -152.0 1.0 116 | 109 -152.0 0.0 117 | 110 -142.0 -31.0 118 | 111 -78.0 -19.0 119 | 112 -78.0 -18.0 120 | 113 -78.0 -17.0 121 | 114 -80.0 -14.0 122 | 115 -118.0 22.0 123 | 116 -107.0 30.0 124 | 117 -85.0 14.0 125 | 118 -78.0 15.0 126 | 119 -15.0 16.0 127 | 120 -62.0 32.0 128 | 121 -120.0 -20.0 129 | 122 -90.0 -22.0 130 | 123 -79.0 -19.0 131 | 124 -79.0 -18.5 132 | 125 -79.0 -18.0 133 | 126 -78.0 -17.5 134 | 127 -79.0 -17.0 135 | 128 -80.0 -17.0 136 | 129 -80.0 -16.0 137 | 130 -80.0 -15.0 138 | 131 -48.0 37.0 139 | 132 -85.0 15.0 140 | 133 -62.0 -9.0 141 | 134 -15.0 -4.0 142 | 135 -1.0 3.2 143 | DEMAND_SECTION 144 | 1 0 145 | 2 30 146 | 3 226 147 | 4 37 148 | 5 24 149 | 6 36 150 | 7 1 151 | 8 31 152 | 9 24 153 | 10 30 154 | 11 24 155 | 12 24 156 | 13 32 157 | 14 24 158 | 15 24 159 | 16 19 160 | 17 24 161 | 18 18 162 | 19 36 163 | 20 115 164 | 21 24 165 | 22 24 166 | 23 61 167 | 24 71 168 | 25 36 169 | 26 18 170 | 27 30 171 | 28 31 172 | 29 36 173 | 30 18 174 | 31 1004 175 | 32 18 176 | 33 34 177 | 34 504 178 | 35 18 179 | 36 39 180 | 37 24 181 | 38 37 182 | 39 24 183 | 40 99 184 | 41 24 185 | 42 24 186 | 43 36 187 | 44 30 188 | 45 25 189 | 46 24 190 | 47 122 191 | 48 196 192 | 49 229 193 | 50 83 194 | 51 18 195 | 52 24 196 | 53 306 197 | 54 18 198 | 55 20 199 | 56 18 200 | 57 24 201 | 58 22 202 | 59 24 203 | 60 18 204 | 61 18 205 | 62 24 206 | 63 24 207 | 64 30 208 | 65 24 209 | 66 40 210 | 67 166 211 | 68 254 212 | 69 187 213 | 70 94 214 | 71 17 215 | 72 285 216 | 73 24 217 | 74 24 218 | 75 205 219 | 76 23 220 | 77 28 221 | 78 51 222 | 79 49 223 | 80 19 224 | 81 262 225 | 82 120 226 | 83 266 227 | 84 704 228 | 85 38 229 | 86 18 230 | 87 30 231 | 88 25 232 | 89 12 233 | 90 18 234 | 91 25 235 | 92 35 236 | 93 18 237 | 94 12 238 | 95 20 239 | 96 1126 240 | 97 9 241 | 98 36 242 | 99 12 243 | 100 31 244 | 101 96 245 | 102 27 246 | 103 54 247 | 104 137 248 | 105 12 249 | 106 58 250 | 107 206 251 | 108 178 252 | 109 486 253 | 110 36 254 | 111 261 255 | 112 135 256 | 113 135 257 | 114 373 258 | 115 535 259 | 116 42 260 | 117 9 261 | 118 110 262 | 119 36 263 | 120 18 264 | 121 726 265 | 122 187 266 | 123 23 267 | 124 134 268 | 125 47 269 | 126 51 270 | 127 43 271 | 128 79 272 | 129 112 273 | 130 91 274 | 131 232 275 | 132 483 276 | 133 828 277 | 134 11 278 | 135 12 279 | DEPOT_SECTION 280 | 1 281 | -1 282 | EOF 283 | 284 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/F-n45-k4.vrp: -------------------------------------------------------------------------------- 1 | NAME : F-n45-k4 2 | COMMENT : (Fisher: problem 10, Min no of trucks: 4, Best value: 728) 3 | TYPE : CVRP 4 | DIMENSION : 45 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 2010 7 | NODE_COORD_SECTION 8 | 1 0 0 9 | 2 3 5 10 | 3 2.5 9 11 | 4 48 16 12 | 5 48 17 13 | 6 69 16 14 | 7 70 16 15 | 8 64 13 16 | 9 3 -22 17 | 10 2.5 1 18 | 11 -13 11.5 19 | 12 -20 45 20 | 13 -9 52 21 | 14 -8.5 53 22 | 15 -8 52 23 | 16 2 2 24 | 17 -2 9 25 | 18 -10 20 26 | 19 -20 19 27 | 20 -15 -21 28 | 21 -5 -9 29 | 22 -4.5 -9 30 | 23 -52 -36 31 | 24 -53 -36 32 | 25 0 0.01 33 | 26 -30 -18 34 | 27 -51 -35 35 | 28 81 9 36 | 29 84 -99 37 | 30 82 -6 38 | 31 40 -12 39 | 32 50 -7 40 | 33 51 -8 41 | 34 63 -17 42 | 35 45 -1 43 | 36 54 8.5 44 | 37 29 4 45 | 38 21 3 46 | 39 22 2 47 | 40 39 -3 48 | 41 39.5 -3 49 | 42 40 -11 50 | 43 28 -2 51 | 44 24 -18 52 | 45 24 -19 53 | DEMAND_SECTION 54 | 1 0 55 | 2 33 56 | 3 15 57 | 4 10 58 | 5 40 59 | 6 15 60 | 7 5 61 | 8 77 62 | 9 435 63 | 10 165 64 | 11 120 65 | 12 65 66 | 13 23 67 | 14 18 68 | 15 550 69 | 16 78 70 | 17 627 71 | 18 9 72 | 19 96 73 | 20 116 74 | 21 116 75 | 22 83 76 | 23 41 77 | 24 645 78 | 25 694 79 | 26 573 80 | 27 1 81 | 28 181 82 | 29 106 83 | 30 52 84 | 31 117 85 | 32 52 86 | 33 1300 87 | 34 57 88 | 35 28 89 | 36 84 90 | 37 1 91 | 38 54 92 | 39 19 93 | 40 88 94 | 41 41 95 | 42 238 96 | 43 66 97 | 44 44 98 | 45 42 99 | DEPOT_SECTION 100 | 1 101 | -1 102 | EOF 103 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/F-n72-k4.vrp: -------------------------------------------------------------------------------- 1 | NAME : F-n72-k4 2 | COMMENT : (Fisher: problem 11, Min no of trucks: 4, Best value: 238) 3 | TYPE : CVRP 4 | DIMENSION : 72 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 30000 7 | NODE_COORD_SECTION 8 | 1 0 0 9 | 2 -12 -6 10 | 3 -15 -5 11 | 4 -1 -18 12 | 5 2 -21 13 | 6 -1 -17 14 | 7 -9 -12 15 | 8 2 -22 16 | 9 1 -21 17 | 10 7 -25 18 | 11 -7 -17 19 | 12 -11 -5 20 | 13 -14 -9 21 | 14 -14 -8 22 | 15 -11 -2 23 | 16 -14 -5 24 | 17 -15 -9 25 | 18 -15 -8 26 | 19 -9 -6 27 | 20 -14 -4 28 | 21 3 6 29 | 22 5 9 30 | 23 5 10 31 | 24 2 8 32 | 25 1 9 33 | 26 1 10 34 | 27 2 9 35 | 28 6 14 36 | 29 5 12 37 | 30 3 7 38 | 31 4 8 39 | 32 -6 1 40 | 33 -6 2 41 | 34 -8 -2 42 | 35 -7 2 43 | 36 -7 -3 44 | 37 -7 -2 45 | 38 -20 12 46 | 39 -20 13 47 | 40 -12 10 48 | 41 -20 15 49 | 42 -6 8 50 | 43 2 21 51 | 44 2 22 52 | 45 1 21 53 | 46 -1 24 54 | 47 1 22 55 | 48 -2 20 56 | 49 -2 21 57 | 50 -4 18 58 | 51 -4 19 59 | 52 -5 18 60 | 53 -5 26 61 | 54 1 23 62 | 55 -6 5 63 | 56 -6 6 64 | 57 -9 6 65 | 58 -9 7 66 | 59 -12 5 67 | 60 -12 6 68 | 61 -11 3 69 | 62 -11 4 70 | 63 -14 4 71 | 64 -14 5 72 | 65 -15 4 73 | 66 -15 5 74 | 67 -16 7 75 | 68 -16 8 76 | 69 -15 10 77 | 70 -20 10 78 | 71 -5 19 79 | 72 -9 -11 80 | DEMAND_SECTION 81 | 1 0 82 | 2 7063 83 | 3 51 84 | 4 23 85 | 5 3074 86 | 6 349 87 | 7 1047 88 | 8 698 89 | 9 3001 90 | 10 31 91 | 11 1135 92 | 12 21611 93 | 13 57 94 | 14 51 95 | 15 551 96 | 16 179 97 | 17 6 98 | 18 528 99 | 19 2832 100 | 20 1514 101 | 21 889 102 | 22 2554 103 | 23 1215 104 | 24 1810 105 | 25 3050 106 | 26 4 107 | 27 1563 108 | 28 741 109 | 29 1532 110 | 30 709 111 | 31 1022 112 | 32 883 113 | 33 1689 114 | 34 10235 115 | 35 29 116 | 36 2894 117 | 37 450 118 | 38 411 119 | 39 207 120 | 40 496 121 | 41 1021 122 | 42 117 123 | 43 46 124 | 44 8 125 | 45 18 126 | 46 561 127 | 47 1877 128 | 48 3542 129 | 49 801 130 | 50 967 131 | 51 62 132 | 52 1366 133 | 53 230 134 | 54 4 135 | 55 12 136 | 56 145 137 | 57 7149 138 | 58 2250 139 | 59 383 140 | 60 134 141 | 61 1947 142 | 62 182 143 | 63 3934 144 | 64 468 145 | 65 18 146 | 66 133 147 | 67 2340 148 | 68 754 149 | 69 1264 150 | 70 806 151 | 71 3665 152 | 72 2452 153 | DEPOT_SECTION 154 | 1 155 | -1 156 | EOF 157 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/tutorial-01-uncapacitated.vrp: -------------------------------------------------------------------------------- 1 | NAME : tutorial-01-uncapacitated 2 | COMMENT : Geoffrey De Smet - OptaPlanner VRP demo 01 3 | TYPE : CVRP 4 | DIMENSION : 8 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 50 50 9 | 2 45 100 10 | 3 30 80 11 | 4 70 85 12 | 5 60 60 13 | 6 35 10 14 | 7 30 30 15 | 8 45 20 16 | DEMAND_SECTION 17 | 1 0 18 | 2 1 19 | 3 1 20 | 4 1 21 | 5 1 22 | 6 1 23 | 7 1 24 | 8 1 25 | DEPOT_SECTION 26 | 1 27 | -1 28 | VEHICLES : 2 29 | EOF 30 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/tutorial-02-capacitated.vrp: -------------------------------------------------------------------------------- 1 | NAME : tutorial-02-capacitated 2 | COMMENT : Geoffrey De Smet - OptaPlanner VRP demo 03 3 | TYPE : CVRP 4 | DIMENSION : 8 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 50 50 9 | 2 45 100 10 | 3 30 80 11 | 4 70 85 12 | 5 60 60 13 | 6 35 10 14 | 7 30 30 15 | 8 45 20 16 | DEMAND_SECTION 17 | 1 0 18 | 2 20 19 | 3 20 20 | 4 20 21 | 5 20 22 | 6 20 23 | 7 20 24 | 8 20 25 | DEPOT_SECTION 26 | 1 27 | -1 28 | VEHICLES : 2 29 | EOF 30 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/tutorial-03-capacitated-hard.vrp: -------------------------------------------------------------------------------- 1 | NAME : tutorial-03-capacitated-hard 2 | COMMENT : Geoffrey De Smet - OptaPlanner VRP demo 02 3 | TYPE : CVRP 4 | DIMENSION : 8 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 50 50 9 | 2 45 100 10 | 3 30 80 11 | 4 70 85 12 | 5 60 60 13 | 6 35 10 14 | 7 30 30 15 | 8 45 20 16 | DEMAND_SECTION 17 | 1 0 18 | 2 20 19 | 3 20 20 | 4 20 21 | 5 20 22 | 6 20 23 | 7 50 24 | 8 50 25 | DEPOT_SECTION 26 | 1 27 | -1 28 | VEHICLES : 2 29 | EOF 30 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/tutorial-04-capacitated-extra-vehicle.vrp: -------------------------------------------------------------------------------- 1 | NAME : tutorial-04-capacitated-extra-vehicle 2 | COMMENT : Geoffrey De Smet - OptaPlanner VRP demo 04 3 | TYPE : CVRP 4 | DIMENSION : 8 5 | EDGE_WEIGHT_TYPE : EUC_2D 6 | CAPACITY : 100 7 | NODE_COORD_SECTION 8 | 1 50 50 9 | 2 45 100 10 | 3 30 80 11 | 4 70 85 12 | 5 60 60 13 | 6 35 10 14 | 7 30 30 15 | 8 45 20 16 | DEMAND_SECTION 17 | 1 0 18 | 2 20 19 | 3 20 20 | 4 20 21 | 5 20 22 | 6 20 23 | 7 50 24 | 8 50 25 | DEPOT_SECTION 26 | 1 27 | -1 28 | VEHICLES : 3 29 | EOF 30 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/tutorial-05-timewindowed-uncapacitated.vrp: -------------------------------------------------------------------------------- 1 | tutorial-05-timewindowed-uncapacitated 2 | 3 | VEHICLE 4 | NUMBER CAPACITY 5 | 2 100 6 | 7 | CUSTOMER 8 | CUST NO. XCOORD. YCOORD. DEMAND READY TIME DUE DATE SERVICE TIME 9 | 10 | 0 50 50 0 0 720 0 11 | 1 45 100 1 60 360 60 12 | 2 30 80 1 60 360 60 13 | 3 70 85 1 60 360 60 14 | 4 60 60 1 60 360 60 15 | 5 35 10 1 60 120 60 16 | 6 30 30 1 120 180 60 17 | 7 45 20 1 180 240 60 18 | -------------------------------------------------------------------------------- /app/src/main/assets/vrps/tutorial-06-timewindowed-capacitated.vrp: -------------------------------------------------------------------------------- 1 | tutorial-06-timewindowed-uncapacitated 2 | 3 | VEHICLE 4 | NUMBER CAPACITY 5 | 2 100 6 | 7 | CUSTOMER 8 | CUST NO. XCOORD. YCOORD. DEMAND READY TIME DUE DATE SERVICE TIME 9 | 10 | 0 50 50 0 0 720 0 11 | 1 45 100 33 60 360 60 12 | 2 30 80 25 60 360 60 13 | 3 70 85 33 60 360 60 14 | 4 60 60 33 60 360 60 15 | 5 35 10 25 60 120 60 16 | 6 30 30 25 120 180 60 17 | 7 45 20 25 180 240 60 18 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/common/domain/AbstractPersistable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.examples.common.domain; 18 | 19 | import java.io.Serializable; 20 | 21 | import org.apache.commons.lang3.builder.CompareToBuilder; 22 | import org.optaplanner.core.api.score.constraint.ConstraintMatch; 23 | 24 | public abstract class AbstractPersistable implements Serializable, Comparable { 25 | 26 | protected Long id; 27 | 28 | protected AbstractPersistable() { 29 | } 30 | 31 | protected AbstractPersistable(long id) { 32 | this.id = id; 33 | } 34 | 35 | public Long getId() { 36 | return id; 37 | } 38 | 39 | public void setId(Long id) { 40 | this.id = id; 41 | } 42 | 43 | // This part is currently commented out because it's probably a bad thing to mix identification with equality 44 | 45 | // public boolean equals(Object o) { 46 | // if (this == o) { 47 | // return true; 48 | // } 49 | // if (id == null || !(o instanceof AbstractPersistable)) { 50 | // return false; 51 | // } else { 52 | // AbstractPersistable other = (AbstractPersistable) o; 53 | // return getClass().equals(other.getClass()) && id.equals(other.id); 54 | // } 55 | // } 56 | // 57 | // public int hashCode() { 58 | // if (id == null) { 59 | // return super.hashCode(); 60 | // } else { 61 | // return id.hashCode(); 62 | // } 63 | // } 64 | 65 | /** 66 | * Used by the GUI to sort the {@link ConstraintMatch} list 67 | * by {@link ConstraintMatch#getJustificationList()}. 68 | * @param other never null 69 | * @return comparison 70 | */ 71 | public int compareTo(AbstractPersistable other) { 72 | return new CompareToBuilder() 73 | .append(getClass().getName(), other.getClass().getName()) 74 | .append(id, other.id) 75 | .toComparison(); 76 | } 77 | 78 | public String toString() { 79 | return "[" + getClass().getName().replaceAll(".*\\.", "") + "-" + id + "]"; 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/domain/Customer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.examples.vehiclerouting.domain; 18 | 19 | import com.thoughtworks.xstream.annotations.XStreamAlias; 20 | import com.thoughtworks.xstream.annotations.XStreamInclude; 21 | import org.optaplanner.core.api.domain.entity.PlanningEntity; 22 | import org.optaplanner.core.api.domain.variable.AnchorShadowVariable; 23 | import org.optaplanner.core.api.domain.variable.PlanningVariable; 24 | import org.optaplanner.core.api.domain.variable.PlanningVariableGraphType; 25 | import org.optaplanner.examples.common.domain.AbstractPersistable; 26 | import org.optaplanner.examples.vehiclerouting.domain.location.Location; 27 | import org.optaplanner.examples.vehiclerouting.domain.solver.DepotAngleCustomerDifficultyWeightFactory; 28 | import org.optaplanner.examples.vehiclerouting.domain.timewindowed.TimeWindowedCustomer; 29 | 30 | @PlanningEntity(difficultyWeightFactoryClass = DepotAngleCustomerDifficultyWeightFactory.class) 31 | @XStreamAlias("VrpCustomer") 32 | @XStreamInclude({ 33 | TimeWindowedCustomer.class 34 | }) 35 | public class Customer extends AbstractPersistable implements Standstill { 36 | 37 | protected Location location; 38 | protected int demand; 39 | 40 | // Planning variables: changes during planning, between score calculations. 41 | protected Standstill previousStandstill; 42 | 43 | // Shadow variables 44 | protected Customer nextCustomer; 45 | protected Vehicle vehicle; 46 | 47 | public Location getLocation() { 48 | return location; 49 | } 50 | 51 | public void setLocation(Location location) { 52 | this.location = location; 53 | } 54 | 55 | public int getDemand() { 56 | return demand; 57 | } 58 | 59 | public void setDemand(int demand) { 60 | this.demand = demand; 61 | } 62 | 63 | @PlanningVariable(valueRangeProviderRefs = {"vehicleRange", "customerRange"}, 64 | graphType = PlanningVariableGraphType.CHAINED) 65 | public Standstill getPreviousStandstill() { 66 | return previousStandstill; 67 | } 68 | 69 | public void setPreviousStandstill(Standstill previousStandstill) { 70 | this.previousStandstill = previousStandstill; 71 | } 72 | 73 | public Customer getNextCustomer() { 74 | return nextCustomer; 75 | } 76 | 77 | public void setNextCustomer(Customer nextCustomer) { 78 | this.nextCustomer = nextCustomer; 79 | } 80 | 81 | @AnchorShadowVariable(sourceVariableName = "previousStandstill") 82 | public Vehicle getVehicle() { 83 | return vehicle; 84 | } 85 | 86 | public void setVehicle(Vehicle vehicle) { 87 | this.vehicle = vehicle; 88 | } 89 | 90 | // ************************************************************************ 91 | // Complex methods 92 | // ************************************************************************ 93 | 94 | /** 95 | * @return a positive number, the distance multiplied by 1000 to avoid floating point arithmetic rounding errors 96 | */ 97 | public int getDistanceFromPreviousStandstill() { 98 | if (previousStandstill == null) { 99 | return 0; 100 | } 101 | return getDistanceFrom(previousStandstill); 102 | } 103 | 104 | /** 105 | * @param standstill never null 106 | * @return a positive number, the distance multiplied by 1000 to avoid floating point arithmetic rounding errors 107 | */ 108 | public int getDistanceFrom(Standstill standstill) { 109 | return standstill.getLocation().getDistance(location); 110 | } 111 | 112 | /** 113 | * @param standstill never null 114 | * @return a positive number, the distance multiplied by 1000 to avoid floating point arithmetic rounding errors 115 | */ 116 | public int getDistanceTo(Standstill standstill) { 117 | return location.getDistance(standstill.getLocation()); 118 | } 119 | 120 | @Override 121 | public String toString() { 122 | return location + "(after " + (previousStandstill == null ? "null" : previousStandstill.getLocation()) + ")"; 123 | } 124 | 125 | } 126 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/domain/Depot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.examples.vehiclerouting.domain; 18 | 19 | import com.thoughtworks.xstream.annotations.XStreamAlias; 20 | import com.thoughtworks.xstream.annotations.XStreamInclude; 21 | import org.optaplanner.examples.common.domain.AbstractPersistable; 22 | import org.optaplanner.examples.vehiclerouting.domain.location.Location; 23 | import org.optaplanner.examples.vehiclerouting.domain.timewindowed.TimeWindowedDepot; 24 | 25 | @XStreamAlias("VrpDepot") 26 | @XStreamInclude({ 27 | TimeWindowedDepot.class 28 | }) 29 | public class Depot extends AbstractPersistable { 30 | 31 | protected Location location; 32 | 33 | public Location getLocation() { 34 | return location; 35 | } 36 | 37 | public void setLocation(Location location) { 38 | this.location = location; 39 | } 40 | 41 | // ************************************************************************ 42 | // Complex methods 43 | // ************************************************************************ 44 | 45 | /** 46 | * @param standstill never null 47 | * @return a positive number, the distance multiplied by 1000 to avoid floating point arithmetic rounding errors 48 | */ 49 | public int getDistanceTo(Standstill standstill) { 50 | return location.getDistance(standstill.getLocation()); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/domain/Standstill.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.examples.vehiclerouting.domain; 18 | 19 | import org.optaplanner.core.api.domain.entity.PlanningEntity; 20 | import org.optaplanner.core.api.domain.variable.InverseRelationShadowVariable; 21 | import org.optaplanner.examples.vehiclerouting.domain.location.Location; 22 | 23 | @PlanningEntity 24 | public interface Standstill { 25 | 26 | /** 27 | * @return never null 28 | */ 29 | Location getLocation(); 30 | 31 | /** 32 | * @return sometimes null 33 | */ 34 | Vehicle getVehicle(); 35 | 36 | /** 37 | * @return sometimes null 38 | */ 39 | @InverseRelationShadowVariable(sourceVariableName = "previousStandstill") 40 | Customer getNextCustomer(); 41 | void setNextCustomer(Customer nextCustomer); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/domain/Vehicle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.examples.vehiclerouting.domain; 18 | 19 | import com.thoughtworks.xstream.annotations.XStreamAlias; 20 | import org.optaplanner.examples.common.domain.AbstractPersistable; 21 | import org.optaplanner.examples.vehiclerouting.domain.location.Location; 22 | 23 | @XStreamAlias("VrpVehicle") 24 | public class Vehicle extends AbstractPersistable implements Standstill { 25 | 26 | protected int capacity; 27 | protected Depot depot; 28 | 29 | // Shadow variables 30 | protected Customer nextCustomer; 31 | 32 | public int getCapacity() { 33 | return capacity; 34 | } 35 | 36 | public void setCapacity(int capacity) { 37 | this.capacity = capacity; 38 | } 39 | 40 | public Depot getDepot() { 41 | return depot; 42 | } 43 | 44 | public void setDepot(Depot depot) { 45 | this.depot = depot; 46 | } 47 | 48 | public Customer getNextCustomer() { 49 | return nextCustomer; 50 | } 51 | 52 | public void setNextCustomer(Customer nextCustomer) { 53 | this.nextCustomer = nextCustomer; 54 | } 55 | 56 | // ************************************************************************ 57 | // Complex methods 58 | // ************************************************************************ 59 | 60 | public Vehicle getVehicle() { 61 | return this; 62 | } 63 | 64 | public Location getLocation() { 65 | return depot.getLocation(); 66 | } 67 | 68 | /** 69 | * @param standstill never null 70 | * @return a positive number, the distance multiplied by 1000 to avoid floating point arithmetic rounding errors 71 | */ 72 | public int getDistanceTo(Standstill standstill) { 73 | return depot.getDistanceTo(standstill); 74 | } 75 | 76 | @Override 77 | public String toString() { 78 | return getLocation() + "[vehicle-" + id + "]"; 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/domain/VehicleRoutingSolution.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.examples.vehiclerouting.domain; 18 | 19 | import java.util.ArrayList; 20 | import java.util.Collection; 21 | import java.util.List; 22 | 23 | import com.thoughtworks.xstream.annotations.XStreamAlias; 24 | import com.thoughtworks.xstream.annotations.XStreamConverter; 25 | import com.thoughtworks.xstream.annotations.XStreamInclude; 26 | import org.optaplanner.core.api.domain.solution.PlanningEntityCollectionProperty; 27 | import org.optaplanner.core.api.domain.solution.PlanningSolution; 28 | import org.optaplanner.core.api.domain.solution.Solution; 29 | import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; 30 | import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore; 31 | import org.optaplanner.core.impl.score.buildin.hardsoft.HardSoftScoreDefinition; 32 | import org.optaplanner.examples.common.domain.AbstractPersistable; 33 | import org.optaplanner.examples.vehiclerouting.domain.location.DistanceType; 34 | import org.optaplanner.examples.vehiclerouting.domain.location.Location; 35 | import org.optaplanner.examples.vehiclerouting.domain.timewindowed.TimeWindowedVehicleRoutingSolution; 36 | import org.optaplanner.persistence.xstream.impl.score.XStreamScoreConverter; 37 | 38 | @PlanningSolution 39 | @XStreamAlias("VrpVehicleRoutingSolution") 40 | @XStreamInclude({ 41 | TimeWindowedVehicleRoutingSolution.class 42 | }) 43 | public class VehicleRoutingSolution extends AbstractPersistable implements Solution { 44 | 45 | protected String name; 46 | protected DistanceType distanceType; 47 | protected String distanceUnitOfMeasurement; 48 | protected List locationList; 49 | protected List depotList; 50 | protected List vehicleList; 51 | 52 | protected List customerList; 53 | 54 | @XStreamConverter(value = XStreamScoreConverter.class, types = {HardSoftScoreDefinition.class}) 55 | protected HardSoftScore score; 56 | 57 | public String getName() { 58 | return name; 59 | } 60 | 61 | public void setName(String name) { 62 | this.name = name; 63 | } 64 | 65 | public DistanceType getDistanceType() { 66 | return distanceType; 67 | } 68 | 69 | public void setDistanceType(DistanceType distanceType) { 70 | this.distanceType = distanceType; 71 | } 72 | 73 | public String getDistanceUnitOfMeasurement() { 74 | return distanceUnitOfMeasurement; 75 | } 76 | 77 | public void setDistanceUnitOfMeasurement(String distanceUnitOfMeasurement) { 78 | this.distanceUnitOfMeasurement = distanceUnitOfMeasurement; 79 | } 80 | 81 | public List getLocationList() { 82 | return locationList; 83 | } 84 | 85 | public void setLocationList(List locationList) { 86 | this.locationList = locationList; 87 | } 88 | 89 | public List getDepotList() { 90 | return depotList; 91 | } 92 | 93 | public void setDepotList(List depotList) { 94 | this.depotList = depotList; 95 | } 96 | 97 | @PlanningEntityCollectionProperty 98 | @ValueRangeProvider(id = "vehicleRange") 99 | public List getVehicleList() { 100 | return vehicleList; 101 | } 102 | 103 | public void setVehicleList(List vehicleList) { 104 | this.vehicleList = vehicleList; 105 | } 106 | 107 | @PlanningEntityCollectionProperty 108 | @ValueRangeProvider(id = "customerRange") 109 | public List getCustomerList() { 110 | return customerList; 111 | } 112 | 113 | public void setCustomerList(List customerList) { 114 | this.customerList = customerList; 115 | } 116 | 117 | public HardSoftScore getScore() { 118 | return score; 119 | } 120 | 121 | public void setScore(HardSoftScore score) { 122 | this.score = score; 123 | } 124 | 125 | // ************************************************************************ 126 | // Complex methods 127 | // ************************************************************************ 128 | 129 | public Collection extends Object> getProblemFacts() { 130 | List facts = new ArrayList(); 131 | facts.addAll(locationList); 132 | facts.addAll(depotList); 133 | // Do not add the planning entities (vehicleList, customerList) because that will be done automatically 134 | return facts; 135 | } 136 | 137 | } 138 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/domain/location/AirLocation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.examples.vehiclerouting.domain.location; 18 | 19 | import com.thoughtworks.xstream.annotations.XStreamAlias; 20 | 21 | /** 22 | * The cost between 2 locations is a straight line: the euclidean distance between their GPS coordinates. 23 | * Used with {@link DistanceType#AIR_DISTANCE}. 24 | */ 25 | @XStreamAlias("VrpAirLocation") 26 | public class AirLocation extends Location { 27 | 28 | public AirLocation() { 29 | } 30 | 31 | public AirLocation(long id, double latitude, double longitude) { 32 | super(id, latitude, longitude); 33 | } 34 | 35 | @Override 36 | public int getDistance(Location location) { 37 | double distance = getAirDistanceDouble(location); 38 | // Multiplied by 1000 to avoid floating point arithmetic rounding errors 39 | return (int) (distance * 1000.0 + 0.5); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/domain/location/DistanceType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.examples.vehiclerouting.domain.location; 18 | 19 | import org.optaplanner.examples.vehiclerouting.domain.location.segmented.HubSegmentLocation; 20 | import org.optaplanner.examples.vehiclerouting.domain.location.segmented.RoadSegmentLocation; 21 | 22 | public enum DistanceType { 23 | /** 24 | * Requires that all {@link Location} instances are of type {@link AirLocation}. 25 | */ 26 | AIR_DISTANCE, 27 | /** 28 | * Requires that all {@link Location} instances are of type {@link RoadLocation}. 29 | */ 30 | ROAD_DISTANCE, 31 | /** 32 | * Requires that all {@link Location} instances are of type {@link RoadSegmentLocation} or {@link HubSegmentLocation}. 33 | */ 34 | SEGMENTED_ROAD_DISTANCE; 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/domain/location/Location.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.examples.vehiclerouting.domain.location; 18 | 19 | import com.thoughtworks.xstream.annotations.XStreamAlias; 20 | import com.thoughtworks.xstream.annotations.XStreamInclude; 21 | import org.optaplanner.examples.common.domain.AbstractPersistable; 22 | import org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution; 23 | 24 | @XStreamAlias("VrpLocation") 25 | @XStreamInclude({ 26 | AirLocation.class, 27 | RoadLocation.class 28 | }) 29 | public abstract class Location extends AbstractPersistable { 30 | 31 | protected String name = null; 32 | protected double latitude; 33 | protected double longitude; 34 | 35 | public Location() { 36 | } 37 | 38 | public Location(long id, double latitude, double longitude) { 39 | super(id); 40 | this.latitude = latitude; 41 | this.longitude = longitude; 42 | } 43 | 44 | public String getName() { 45 | return name; 46 | } 47 | 48 | public void setName(String name) { 49 | this.name = name; 50 | } 51 | 52 | public double getLatitude() { 53 | return latitude; 54 | } 55 | 56 | public void setLatitude(double latitude) { 57 | this.latitude = latitude; 58 | } 59 | 60 | public double getLongitude() { 61 | return longitude; 62 | } 63 | 64 | public void setLongitude(double longitude) { 65 | this.longitude = longitude; 66 | } 67 | 68 | // ************************************************************************ 69 | // Complex methods 70 | // ************************************************************************ 71 | 72 | /** 73 | * The distance's unit of measurement depends on the {@link VehicleRoutingSolution}'s {@link DistanceType}. 74 | * It can be in miles or km, but for most cases it's in the TSPLIB's unit of measurement. 75 | * @param location never null 76 | * @return a positive number, the distance multiplied by 1000 to avoid floating point arithmetic rounding errors 77 | */ 78 | public abstract int getDistance(Location location); 79 | 80 | public double getAirDistanceDouble(Location location) { 81 | // Implementation specified by TSPLIB http://www2.iwr.uni-heidelberg.de/groups/comopt/software/TSPLIB95/ 82 | // Euclidean distance (Pythagorean theorem) - not correct when the surface is a sphere 83 | double latitudeDifference = location.latitude - latitude; 84 | double longitudeDifference = location.longitude - longitude; 85 | return Math.sqrt( 86 | (latitudeDifference * latitudeDifference) + (longitudeDifference * longitudeDifference)); 87 | } 88 | 89 | /** 90 | * The angle relative to the direction EAST. 91 | * @param location never null 92 | * @return in Cartesian coordinates 93 | */ 94 | public double getAngle(Location location) { 95 | // Euclidean distance (Pythagorean theorem) - not correct when the surface is a sphere 96 | double latitudeDifference = location.latitude - latitude; 97 | double longitudeDifference = location.longitude - longitude; 98 | return Math.atan2(latitudeDifference, longitudeDifference); 99 | } 100 | 101 | 102 | @Override 103 | public String toString() { 104 | if (name == null) { 105 | return id.toString(); 106 | } 107 | return id.toString() + "-" + name; 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/domain/location/RoadLocation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.examples.vehiclerouting.domain.location; 18 | 19 | import java.util.Map; 20 | 21 | import com.thoughtworks.xstream.annotations.XStreamAlias; 22 | 23 | /** 24 | * The cost between 2 locations was precalculated on a real road network route. 25 | * The cost itself might be the distance in km, the travel time, the fuel usage or a weighted function of any of those. 26 | * Used with {@link DistanceType#ROAD_DISTANCE}. 27 | */ 28 | @XStreamAlias("VrpRoadLocation") 29 | public class RoadLocation extends Location { 30 | 31 | // Prefer Map over array or List because customers might be added and removed in real-time planning. 32 | protected Map travelDistanceMap; 33 | 34 | public RoadLocation() { 35 | } 36 | 37 | public RoadLocation(long id, double latitude, double longitude) { 38 | super(id, latitude, longitude); 39 | } 40 | 41 | public Map getTravelDistanceMap() { 42 | return travelDistanceMap; 43 | } 44 | 45 | public void setTravelDistanceMap(Map travelDistanceMap) { 46 | this.travelDistanceMap = travelDistanceMap; 47 | } 48 | 49 | @Override 50 | public int getDistance(Location location) { 51 | if (this == location) { 52 | return 0; 53 | } 54 | double distance = travelDistanceMap.get((RoadLocation) location); 55 | // Multiplied by 1000 to avoid floating point arithmetic rounding errors 56 | return (int) (distance * 1000.0 + 0.5); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/domain/location/segmented/HubSegmentLocation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.examples.vehiclerouting.domain.location.segmented; 18 | 19 | import java.util.Map; 20 | 21 | import com.thoughtworks.xstream.annotations.XStreamAlias; 22 | import org.optaplanner.examples.vehiclerouting.domain.location.DistanceType; 23 | import org.optaplanner.examples.vehiclerouting.domain.location.Location; 24 | 25 | /** 26 | * Assistant for {@link RoadSegmentLocation}. 27 | * Used with {@link DistanceType#SEGMENTED_ROAD_DISTANCE}. 28 | */ 29 | @XStreamAlias("VrpHubSegmentLocation") 30 | public class HubSegmentLocation extends Location { 31 | 32 | // Prefer Map over array or List because customers might be added and removed in real-time planning. 33 | protected Map nearbyTravelDistanceMap; 34 | protected Map hubTravelDistanceMap; 35 | 36 | public HubSegmentLocation() { 37 | } 38 | 39 | public HubSegmentLocation(long id, double latitude, double longitude) { 40 | super(id, latitude, longitude); 41 | } 42 | 43 | public Map getNearbyTravelDistanceMap() { 44 | return nearbyTravelDistanceMap; 45 | } 46 | 47 | public void setNearbyTravelDistanceMap(Map nearbyTravelDistanceMap) { 48 | this.nearbyTravelDistanceMap = nearbyTravelDistanceMap; 49 | } 50 | 51 | public Map getHubTravelDistanceMap() { 52 | return hubTravelDistanceMap; 53 | } 54 | 55 | public void setHubTravelDistanceMap(Map hubTravelDistanceMap) { 56 | this.hubTravelDistanceMap = hubTravelDistanceMap; 57 | } 58 | 59 | @Override 60 | public int getDistance(Location location) { 61 | double distance; 62 | if (location instanceof RoadSegmentLocation) { 63 | distance = getDistanceDouble((RoadSegmentLocation) location); 64 | } else { 65 | distance = hubTravelDistanceMap.get((HubSegmentLocation) location); 66 | } 67 | // Multiplied by 1000 to avoid floating point arithmetic rounding errors 68 | return (int) (distance * 1000.0 + 0.5); 69 | } 70 | 71 | public double getDistanceDouble(RoadSegmentLocation location) { 72 | Double distance = nearbyTravelDistanceMap.get(location); 73 | if (distance == null) { 74 | // location isn't nearby 75 | distance = getShortestDistanceDoubleThroughOtherHub(location); 76 | } 77 | return distance; 78 | } 79 | 80 | protected double getShortestDistanceDoubleThroughOtherHub(RoadSegmentLocation location) { 81 | double shortestDistance = Double.MAX_VALUE; 82 | // Don't use location.getHubTravelDistanceMap().keySet() instead because distances aren't always paired 83 | for (Map.Entry otherHubEntry : hubTravelDistanceMap.entrySet()) { 84 | HubSegmentLocation otherHub = otherHubEntry.getKey(); 85 | Double otherHubNearbyDistance = otherHub.nearbyTravelDistanceMap.get(location); 86 | if (otherHubNearbyDistance != null) { 87 | double distance = otherHubEntry.getValue() + otherHubNearbyDistance; 88 | if (distance < shortestDistance) { 89 | shortestDistance = distance; 90 | } 91 | } 92 | } 93 | return shortestDistance; 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/domain/location/segmented/RoadSegmentLocation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.examples.vehiclerouting.domain.location.segmented; 18 | 19 | import java.util.Map; 20 | 21 | import com.thoughtworks.xstream.annotations.XStreamAlias; 22 | import org.optaplanner.examples.vehiclerouting.domain.location.DistanceType; 23 | import org.optaplanner.examples.vehiclerouting.domain.location.Location; 24 | import org.optaplanner.examples.vehiclerouting.domain.location.RoadLocation; 25 | 26 | /** 27 | * Like {@link RoadLocation}, 28 | * but for high scale problems to avoid the memory issue of keeping the entire cost matrix in memory. 29 | * Used with {@link DistanceType#SEGMENTED_ROAD_DISTANCE}. 30 | */ 31 | @XStreamAlias("VrpRoadSegmentLocation") 32 | public class RoadSegmentLocation extends Location { 33 | 34 | // Prefer Map over array or List because customers might be added and removed in real-time planning. 35 | protected Map nearbyTravelDistanceMap; 36 | protected Map hubTravelDistanceMap; 37 | 38 | public RoadSegmentLocation() { 39 | } 40 | 41 | public RoadSegmentLocation(long id, double latitude, double longitude) { 42 | super(id, latitude, longitude); 43 | } 44 | 45 | public Map getNearbyTravelDistanceMap() { 46 | return nearbyTravelDistanceMap; 47 | } 48 | 49 | public void setNearbyTravelDistanceMap(Map nearbyTravelDistanceMap) { 50 | this.nearbyTravelDistanceMap = nearbyTravelDistanceMap; 51 | } 52 | 53 | public Map getHubTravelDistanceMap() { 54 | return hubTravelDistanceMap; 55 | } 56 | 57 | public void setHubTravelDistanceMap(Map hubTravelDistanceMap) { 58 | this.hubTravelDistanceMap = hubTravelDistanceMap; 59 | } 60 | 61 | @Override 62 | public int getDistance(Location location) { 63 | Double distance = getDistanceDouble((RoadSegmentLocation) location); 64 | // Multiplied by 1000 to avoid floating point arithmetic rounding errors 65 | return (int) (distance * 1000.0 + 0.5); 66 | } 67 | 68 | public Double getDistanceDouble(RoadSegmentLocation location) { 69 | Double distance = nearbyTravelDistanceMap.get((RoadSegmentLocation) location); 70 | if (distance == null) { 71 | // location isn't nearby 72 | distance = getShortestDistanceDoubleThroughHubs((RoadSegmentLocation) location); 73 | } 74 | return distance; 75 | } 76 | 77 | protected double getShortestDistanceDoubleThroughHubs(RoadSegmentLocation location) { 78 | double shortestDistance = Double.MAX_VALUE; 79 | for (Map.Entry entry : hubTravelDistanceMap.entrySet()) { 80 | double distance = entry.getValue(); 81 | distance += entry.getKey().getDistanceDouble(location); 82 | if (distance < shortestDistance) { 83 | shortestDistance = distance; 84 | } 85 | } 86 | return shortestDistance; 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/domain/solver/DepotAngleCustomerDifficultyWeightFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.examples.vehiclerouting.domain.solver; 18 | 19 | import org.apache.commons.lang3.builder.CompareToBuilder; 20 | import org.optaplanner.core.impl.heuristic.selector.common.decorator.SelectionSorterWeightFactory; 21 | import org.optaplanner.examples.vehiclerouting.domain.Customer; 22 | import org.optaplanner.examples.vehiclerouting.domain.Depot; 23 | import org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution; 24 | 25 | /** 26 | * On large datasets, the constructed solution looks like pizza slices. 27 | */ 28 | public class DepotAngleCustomerDifficultyWeightFactory 29 | implements SelectionSorterWeightFactory { 30 | 31 | public Comparable createSorterWeight(VehicleRoutingSolution vehicleRoutingSolution, Customer customer) { 32 | Depot depot = vehicleRoutingSolution.getDepotList().get(0); 33 | return new DepotAngleCustomerDifficultyWeight(customer, 34 | customer.getLocation().getAngle(depot.getLocation()), 35 | customer.getLocation().getDistance(depot.getLocation()) 36 | + depot.getLocation().getDistance(customer.getLocation())); 37 | } 38 | 39 | public static class DepotAngleCustomerDifficultyWeight 40 | implements Comparable { 41 | 42 | private final Customer customer; 43 | private final double depotAngle; 44 | private final int depotRoundTripDistance; 45 | 46 | public DepotAngleCustomerDifficultyWeight(Customer customer, 47 | double depotAngle, int depotRoundTripDistance) { 48 | this.customer = customer; 49 | this.depotAngle = depotAngle; 50 | this.depotRoundTripDistance = depotRoundTripDistance; 51 | } 52 | 53 | public int compareTo(DepotAngleCustomerDifficultyWeight other) { 54 | return new CompareToBuilder() 55 | .append(depotAngle, other.depotAngle) 56 | .append(depotRoundTripDistance, other.depotRoundTripDistance) // Ascending (further from the depot are more difficult) 57 | .append(customer.getId(), other.customer.getId()) 58 | .toComparison(); 59 | } 60 | 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/domain/timewindowed/TimeWindowedCustomer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.examples.vehiclerouting.domain.timewindowed; 18 | 19 | import com.thoughtworks.xstream.annotations.XStreamAlias; 20 | import org.optaplanner.core.api.domain.entity.PlanningEntity; 21 | import org.optaplanner.core.api.domain.variable.CustomShadowVariable; 22 | import org.optaplanner.examples.vehiclerouting.domain.Customer; 23 | import org.optaplanner.examples.vehiclerouting.domain.Standstill; 24 | import org.optaplanner.examples.vehiclerouting.domain.timewindowed.solver.ArrivalTimeUpdatingVariableListener; 25 | 26 | @PlanningEntity 27 | @XStreamAlias("VrpTimeWindowedCustomer") 28 | public class TimeWindowedCustomer extends Customer { 29 | 30 | // Times are multiplied by 1000 to avoid floating point arithmetic rounding errors 31 | private int readyTime; 32 | private int dueTime; 33 | private int serviceDuration; 34 | 35 | // Shadow variable 36 | private Integer arrivalTime; 37 | 38 | /** 39 | * @return a positive number, the time multiplied by 1000 to avoid floating point arithmetic rounding errors 40 | */ 41 | public int getReadyTime() { 42 | return readyTime; 43 | } 44 | 45 | public void setReadyTime(int readyTime) { 46 | this.readyTime = readyTime; 47 | } 48 | 49 | /** 50 | * @return a positive number, the time multiplied by 1000 to avoid floating point arithmetic rounding errors 51 | */ 52 | public int getDueTime() { 53 | return dueTime; 54 | } 55 | 56 | public void setDueTime(int dueTime) { 57 | this.dueTime = dueTime; 58 | } 59 | 60 | /** 61 | * @return a positive number, the time multiplied by 1000 to avoid floating point arithmetic rounding errors 62 | */ 63 | public int getServiceDuration() { 64 | return serviceDuration; 65 | } 66 | 67 | public void setServiceDuration(int serviceDuration) { 68 | this.serviceDuration = serviceDuration; 69 | } 70 | 71 | /** 72 | * @return a positive number, the time multiplied by 1000 to avoid floating point arithmetic rounding errors 73 | */ 74 | @CustomShadowVariable(variableListenerClass = ArrivalTimeUpdatingVariableListener.class, 75 | sources = {@CustomShadowVariable.Source(variableName = "previousStandstill")}) 76 | public Integer getArrivalTime() { 77 | return arrivalTime; 78 | } 79 | 80 | public void setArrivalTime(Integer arrivalTime) { 81 | this.arrivalTime = arrivalTime; 82 | } 83 | 84 | // ************************************************************************ 85 | // Complex methods 86 | // ************************************************************************ 87 | 88 | /** 89 | * @return a positive number, the time multiplied by 1000 to avoid floating point arithmetic rounding errors 90 | */ 91 | public Integer getDepartureTime() { 92 | if (arrivalTime == null) { 93 | return null; 94 | } 95 | return Math.max(arrivalTime, readyTime) + serviceDuration; 96 | } 97 | 98 | public boolean isArrivalBeforeReadyTime() { 99 | return arrivalTime != null 100 | && arrivalTime < readyTime; 101 | } 102 | 103 | public boolean isArrivalAfterDueTime() { 104 | return arrivalTime != null 105 | && dueTime < arrivalTime; 106 | } 107 | 108 | @Override 109 | public TimeWindowedCustomer getNextCustomer() { 110 | return (TimeWindowedCustomer) super.getNextCustomer(); 111 | } 112 | 113 | /** 114 | * @return a positive number, the time multiplied by 1000 to avoid floating point arithmetic rounding errors 115 | */ 116 | public int getTimeWindowGapTo(TimeWindowedCustomer other) { 117 | // dueTime doesn't account for serviceDuration 118 | int latestDepartureTime = dueTime + serviceDuration; 119 | int otherLatestDepartureTime = other.getDueTime() + other.getServiceDuration(); 120 | if (latestDepartureTime < other.getReadyTime()) { 121 | return other.getReadyTime() - latestDepartureTime; 122 | } 123 | if (otherLatestDepartureTime < readyTime) { 124 | return readyTime - otherLatestDepartureTime; 125 | } 126 | return 0; 127 | } 128 | 129 | } 130 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/domain/timewindowed/TimeWindowedDepot.java: -------------------------------------------------------------------------------- 1 | package org.optaplanner.examples.vehiclerouting.domain.timewindowed; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | import org.optaplanner.examples.vehiclerouting.domain.Depot; 5 | 6 | @XStreamAlias("VrpTimeWindowedDepot") 7 | public class TimeWindowedDepot extends Depot { 8 | 9 | // Times are multiplied by 1000 to avoid floating point arithmetic rounding errors 10 | private int readyTime; 11 | private int dueTime; 12 | 13 | /** 14 | * @return a positive number, the time multiplied by 1000 to avoid floating point arithmetic rounding errors 15 | */ 16 | public int getReadyTime() { 17 | return readyTime; 18 | } 19 | 20 | public void setReadyTime(int readyTime) { 21 | this.readyTime = readyTime; 22 | } 23 | 24 | /** 25 | * @return a positive number, the time multiplied by 1000 to avoid floating point arithmetic rounding errors 26 | */ 27 | public int getDueTime() { 28 | return dueTime; 29 | } 30 | 31 | public void setDueTime(int dueTime) { 32 | this.dueTime = dueTime; 33 | } 34 | 35 | // ************************************************************************ 36 | // Complex methods 37 | // ************************************************************************ 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/domain/timewindowed/TimeWindowedVehicleRoutingSolution.java: -------------------------------------------------------------------------------- 1 | package org.optaplanner.examples.vehiclerouting.domain.timewindowed; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | import org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution; 5 | 6 | @XStreamAlias("VrpTimeWindowedVehicleRoutingSolution") 7 | public class TimeWindowedVehicleRoutingSolution extends VehicleRoutingSolution { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/domain/timewindowed/solver/ArrivalTimeUpdatingVariableListener.java: -------------------------------------------------------------------------------- 1 | package org.optaplanner.examples.vehiclerouting.domain.timewindowed.solver; 2 | 3 | import org.apache.commons.lang3.ObjectUtils; 4 | import org.optaplanner.core.impl.domain.variable.listener.VariableListener; 5 | import org.optaplanner.core.impl.score.director.ScoreDirector; 6 | import org.optaplanner.examples.vehiclerouting.domain.Customer; 7 | import org.optaplanner.examples.vehiclerouting.domain.Standstill; 8 | import org.optaplanner.examples.vehiclerouting.domain.timewindowed.TimeWindowedCustomer; 9 | 10 | // TODO When this class is added only for TimeWindowedCustomer, use TimeWindowedCustomer instead of Customer 11 | public class ArrivalTimeUpdatingVariableListener implements VariableListener { 12 | 13 | public void beforeEntityAdded(ScoreDirector scoreDirector, Customer customer) { 14 | // Do nothing 15 | } 16 | 17 | public void afterEntityAdded(ScoreDirector scoreDirector, Customer customer) { 18 | if (customer instanceof TimeWindowedCustomer) { 19 | updateVehicle(scoreDirector, (TimeWindowedCustomer) customer); 20 | } 21 | } 22 | 23 | public void beforeVariableChanged(ScoreDirector scoreDirector, Customer customer) { 24 | // Do nothing 25 | } 26 | 27 | public void afterVariableChanged(ScoreDirector scoreDirector, Customer customer) { 28 | if (customer instanceof TimeWindowedCustomer) { 29 | updateVehicle(scoreDirector, (TimeWindowedCustomer) customer); 30 | } 31 | } 32 | 33 | public void beforeEntityRemoved(ScoreDirector scoreDirector, Customer customer) { 34 | // Do nothing 35 | } 36 | 37 | public void afterEntityRemoved(ScoreDirector scoreDirector, Customer customer) { 38 | // Do nothing 39 | } 40 | 41 | protected void updateVehicle(ScoreDirector scoreDirector, TimeWindowedCustomer sourceCustomer) { 42 | Standstill previousStandstill = sourceCustomer.getPreviousStandstill(); 43 | Integer departureTime = (previousStandstill instanceof TimeWindowedCustomer) 44 | ? ((TimeWindowedCustomer) previousStandstill).getDepartureTime() : null; 45 | TimeWindowedCustomer shadowCustomer = sourceCustomer; 46 | Integer arrivalTime = calculateArrivalTime(shadowCustomer, departureTime); 47 | while (shadowCustomer != null && ObjectUtils.notEqual(shadowCustomer.getArrivalTime(), arrivalTime)) { 48 | scoreDirector.beforeVariableChanged(shadowCustomer, "arrivalTime"); 49 | shadowCustomer.setArrivalTime(arrivalTime); 50 | scoreDirector.afterVariableChanged(shadowCustomer, "arrivalTime"); 51 | departureTime = shadowCustomer.getDepartureTime(); 52 | shadowCustomer = shadowCustomer.getNextCustomer(); 53 | arrivalTime = calculateArrivalTime(shadowCustomer, departureTime); 54 | } 55 | } 56 | 57 | private Integer calculateArrivalTime(TimeWindowedCustomer customer, Integer previousDepartureTime) { 58 | if (customer == null) { 59 | return null; 60 | } 61 | if (previousDepartureTime == null) { 62 | // PreviousStandstill is the Vehicle, so we leave from the Depot at the best suitable time 63 | return Math.max(customer.getReadyTime(), customer.getDistanceFromPreviousStandstill()); 64 | } 65 | return previousDepartureTime + customer.getDistanceFromPreviousStandstill(); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/persistence/VehicleRoutingImporter.java: -------------------------------------------------------------------------------- 1 | package org.optaplanner.examples.vehiclerouting.persistence; 2 | 3 | import org.apache.commons.io.IOUtils; 4 | import org.optaplanner.core.api.domain.solution.Solution; 5 | import org.optaplanner.examples.common.persistence.TxtInputBuilder; 6 | 7 | import java.io.BufferedReader; 8 | import java.io.IOException; 9 | import java.io.InputStream; 10 | import java.io.InputStreamReader; 11 | 12 | public class VehicleRoutingImporter { 13 | 14 | public static Solution readSolution(String inputFileName, InputStream inputFileStream) { 15 | Solution solution; 16 | BufferedReader bufferedReader = null; 17 | try { 18 | bufferedReader = new BufferedReader(new InputStreamReader(inputFileStream)); 19 | TxtInputBuilder txtInputBuilder = new VehicleRoutingInputBuilder(); 20 | txtInputBuilder.setInputFile(inputFileName); 21 | txtInputBuilder.setBufferedReader(bufferedReader); 22 | try { 23 | solution = txtInputBuilder.readSolution(); 24 | } catch (IllegalArgumentException e) { 25 | throw new IllegalArgumentException("Exception in inputFile (" + inputFileName + ")", e); 26 | } catch (IllegalStateException e) { 27 | throw new IllegalStateException("Exception in inputFile (" + inputFileName + ")", e); 28 | } 29 | } catch (IOException e) { 30 | throw new IllegalArgumentException("Could not read the file (" + inputFileName + ").", e); 31 | } finally { 32 | IOUtils.closeQuietly(bufferedReader); 33 | } 34 | /** TODO enable logger 35 | logger.info("Imported: {}", inputFile); 36 | */ 37 | return solution; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/examples/vehiclerouting/solver/score/VehicleRoutingEasyScoreCalculator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.examples.vehiclerouting.solver.score; 18 | 19 | import java.util.HashMap; 20 | import java.util.List; 21 | import java.util.Map; 22 | 23 | import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore; 24 | import org.optaplanner.core.impl.score.director.easy.EasyScoreCalculator; 25 | import org.optaplanner.examples.vehiclerouting.domain.Customer; 26 | import org.optaplanner.examples.vehiclerouting.domain.Standstill; 27 | import org.optaplanner.examples.vehiclerouting.domain.Vehicle; 28 | import org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution; 29 | import org.optaplanner.examples.vehiclerouting.domain.timewindowed.TimeWindowedCustomer; 30 | import org.optaplanner.examples.vehiclerouting.domain.timewindowed.TimeWindowedVehicleRoutingSolution; 31 | 32 | public class VehicleRoutingEasyScoreCalculator implements EasyScoreCalculator { 33 | 34 | public HardSoftScore calculateScore(VehicleRoutingSolution solution) { 35 | boolean timeWindowed = solution instanceof TimeWindowedVehicleRoutingSolution; 36 | List customerList = solution.getCustomerList(); 37 | List vehicleList = solution.getVehicleList(); 38 | Map vehicleDemandMap = new HashMap(vehicleList.size()); 39 | for (Vehicle vehicle : vehicleList) { 40 | vehicleDemandMap.put(vehicle, 0); 41 | } 42 | int hardScore = 0; 43 | int softScore = 0; 44 | for (Customer customer : customerList) { 45 | Standstill previousStandstill = customer.getPreviousStandstill(); 46 | if (previousStandstill != null) { 47 | Vehicle vehicle = customer.getVehicle(); 48 | vehicleDemandMap.put(vehicle, vehicleDemandMap.get(vehicle) + customer.getDemand()); 49 | // Score constraint distanceToPreviousStandstill 50 | softScore -= customer.getDistanceFromPreviousStandstill(); 51 | if (customer.getNextCustomer() == null) { 52 | // Score constraint distanceFromLastCustomerToDepot 53 | softScore -= customer.getLocation().getDistance(vehicle.getLocation()); 54 | } 55 | if (timeWindowed) { 56 | TimeWindowedCustomer timeWindowedCustomer = (TimeWindowedCustomer) customer; 57 | int dueTime = timeWindowedCustomer.getDueTime(); 58 | Integer arrivalTime = timeWindowedCustomer.getArrivalTime(); 59 | if (dueTime < arrivalTime) { 60 | // Score constraint arrivalAfterDueTime 61 | hardScore -= (arrivalTime - dueTime); 62 | } 63 | } 64 | } 65 | } 66 | for (Map.Entry entry : vehicleDemandMap.entrySet()) { 67 | int capacity = entry.getKey().getCapacity(); 68 | int demand = entry.getValue(); 69 | if (demand > capacity) { 70 | // Score constraint vehicleCapacity 71 | hardScore -= (demand - capacity); 72 | } 73 | } 74 | // Score constraint arrivalAfterDueTimeAtDepot is a build-in hard constraint in VehicleRoutingImporter 75 | return HardSoftScore.valueOf(hardScore, softScore); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/persistence/xstream/impl/score/XStreamBendableScoreConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.persistence.xstream.impl.score; 18 | 19 | import org.optaplanner.core.impl.score.buildin.bendable.BendableScoreDefinition; 20 | 21 | public class XStreamBendableScoreConverter extends XStreamScoreConverter { 22 | 23 | public XStreamBendableScoreConverter(int hardLevelsSize, int softLevelsSize) { 24 | super(new BendableScoreDefinition(hardLevelsSize, softLevelsSize)); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/org/optaplanner/persistence/xstream/impl/score/XStreamScoreConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 JBoss Inc 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.optaplanner.persistence.xstream.impl.score; 18 | 19 | import com.thoughtworks.xstream.converters.Converter; 20 | import com.thoughtworks.xstream.converters.MarshallingContext; 21 | import com.thoughtworks.xstream.converters.UnmarshallingContext; 22 | import com.thoughtworks.xstream.io.HierarchicalStreamReader; 23 | import com.thoughtworks.xstream.io.HierarchicalStreamWriter; 24 | import org.optaplanner.core.api.score.Score; 25 | import org.optaplanner.core.api.score.buildin.bendable.BendableScore; 26 | import org.optaplanner.core.impl.score.definition.ScoreDefinition; 27 | 28 | /** 29 | * Some {@link Score} implementations require specific subclasses: 30 | * For {@link BendableScore}, use {@link XStreamBendableScoreConverter}. 31 | */ 32 | public class XStreamScoreConverter implements Converter { 33 | 34 | private final ScoreDefinition scoreDefinition; 35 | 36 | public XStreamScoreConverter(ScoreDefinition scoreDefinition) { 37 | this.scoreDefinition = scoreDefinition; 38 | } 39 | 40 | public XStreamScoreConverter(Class extends Score> scoreClass, 41 | Class extends ScoreDefinition> scoreDefinitionClass) { 42 | if (BendableScore.class.equals(scoreClass)) { 43 | throw new IllegalArgumentException(XStreamScoreConverter.class + " is not compatible with scoreClass (" 44 | + scoreClass + "), use " + XStreamBendableScoreConverter.class.getSimpleName() + " instead."); 45 | } 46 | try { 47 | scoreDefinition = scoreDefinitionClass.newInstance(); 48 | } catch (InstantiationException e) { 49 | throw new IllegalArgumentException("The scoreDefinitionClass (" + scoreDefinitionClass 50 | + ") does not have a public no-arg constructor", e); 51 | } catch (IllegalAccessException e) { 52 | throw new IllegalArgumentException("The scoreDefinitionClass (" + scoreDefinitionClass 53 | + ") does not have a public no-arg constructor", e); 54 | } 55 | if (scoreClass != scoreDefinition.getScoreClass()) { 56 | throw new IllegalStateException("The scoreClass (" + scoreClass + ") of the Score field to serialize to XML" 57 | + " does not match the scoreDefinition's scoreClass (" + scoreDefinition.getScoreClass() + ")."); 58 | } 59 | } 60 | 61 | public boolean canConvert(Class type) { 62 | return scoreDefinition.getScoreClass().isAssignableFrom(type); 63 | } 64 | 65 | public void marshal(Object scoreObject, HierarchicalStreamWriter writer, MarshallingContext context) { 66 | String scoreString = scoreDefinition.formatScore((Score) scoreObject); 67 | writer.setValue(scoreString); 68 | } 69 | 70 | public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { 71 | String scoreString = reader.getValue(); 72 | return scoreDefinition.parseScore(scoreString); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/org/tomasdavid/vehicleroutingproblem/MainActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Tomas David 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.tomasdavid.vehicleroutingproblem; 18 | 19 | import android.os.Bundle; 20 | import android.support.v4.app.Fragment; 21 | import android.support.v4.widget.DrawerLayout; 22 | import android.support.v7.app.ActionBarActivity; 23 | import android.support.v7.widget.Toolbar; 24 | import android.view.Gravity; 25 | 26 | import org.tomasdavid.vehicleroutingproblem.components.StopSolverDialog; 27 | import org.tomasdavid.vehicleroutingproblem.fragments.MainFragment; 28 | import org.tomasdavid.vehicleroutingproblem.fragments.VrpFragment; 29 | import org.tomasdavid.vehicleroutingproblem.tasks.VrpSolverTask; 30 | 31 | /** 32 | * Main and only activity of application. 33 | * 34 | * @author Tomas David 35 | */ 36 | public class MainActivity extends ActionBarActivity { 37 | 38 | /** 39 | * Navigation drawer for displaying statistics. 40 | */ 41 | private DrawerLayout statsDrawer; 42 | 43 | /** 44 | * Unlock navigation drawer. 45 | */ 46 | public void unlockDrawer() { 47 | statsDrawer.setDrawerLockMode(DrawerLayout.VISIBLE); 48 | } 49 | 50 | /** 51 | * Hide and lock navigation drawer. 52 | */ 53 | public void lockDrawer() { 54 | statsDrawer.closeDrawer(Gravity.START); 55 | statsDrawer.setDrawerLockMode(DrawerLayout.INVISIBLE); 56 | } 57 | 58 | /** 59 | * {@inheritDoc} 60 | */ 61 | @Override 62 | public void onCreate(Bundle savedInstanceState) { 63 | super.onCreate(savedInstanceState); 64 | setContentView(R.layout.activity_main); 65 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 66 | toolbar.setTitle(R.string.app_name); 67 | setSupportActionBar(toolbar); 68 | statsDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); 69 | lockDrawer(); 70 | if (savedInstanceState == null) { 71 | MainFragment fragment = new MainFragment(); 72 | getSupportFragmentManager().beginTransaction().add(R.id.activity_main, fragment).commit(); 73 | } 74 | } 75 | 76 | /** 77 | * {@inheritDoc} 78 | */ 79 | @Override 80 | public void onBackPressed() { 81 | Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.activity_main); 82 | if (fragment instanceof VrpFragment) { 83 | VrpSolverTask vrpSolverTask = ((VrpFragment) fragment).getVrpSolverTask(); 84 | if (vrpSolverTask.isRunning()) { 85 | new StopSolverDialog().show(getSupportFragmentManager(), null); 86 | return; 87 | } else { 88 | lockDrawer(); 89 | ((Toolbar) findViewById(R.id.toolbar)).setNavigationIcon(null); 90 | } 91 | } 92 | super.onBackPressed(); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /app/src/main/java/org/tomasdavid/vehicleroutingproblem/VrpKeys.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Tomas David 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.tomasdavid.vehicleroutingproblem; 18 | 19 | /** 20 | * Vrp keys for mark items in bundle. 21 | * 22 | * @author Tomas David 23 | */ 24 | public enum VrpKeys { 25 | VRP_FILE_NAME, 26 | VRP_TIME_LIMIT, 27 | VRP_ALGORITHM 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/org/tomasdavid/vehicleroutingproblem/adapters/StatisticItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Tomas David 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.tomasdavid.vehicleroutingproblem.adapters; 18 | 19 | /** 20 | * Statistic item for navigation drawer. Consists from image, name and value in one line. 21 | * 22 | * @author Tomas David 23 | */ 24 | public class StatisticItem { 25 | 26 | /** 27 | * Id of resource image. 28 | */ 29 | private int imageResId; 30 | 31 | /** 32 | * Item name. 33 | */ 34 | private String name; 35 | 36 | /** 37 | * Item value. 38 | */ 39 | private String value; 40 | 41 | /** 42 | * Default constructor. 43 | * @param imageResId Id of resource image. 44 | * @param name Item name. 45 | * @param value Item value. 46 | */ 47 | public StatisticItem(int imageResId, String name, String value) { 48 | this.imageResId = imageResId; 49 | this.name = name; 50 | this.value = value; 51 | } 52 | 53 | /** 54 | * Returns id of resource image. 55 | * @return Id of resource image. 56 | */ 57 | public int getImageResId() { 58 | return imageResId; 59 | } 60 | 61 | /** 62 | * Returns name of item. 63 | * @return Item name. 64 | */ 65 | public String getName() { 66 | return name; 67 | } 68 | 69 | /** 70 | * Returns value of item. 71 | * @return Item value. 72 | */ 73 | public String getValue() { 74 | return value; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /app/src/main/java/org/tomasdavid/vehicleroutingproblem/adapters/StatisticsListAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Tomas David 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.tomasdavid.vehicleroutingproblem.adapters; 18 | 19 | import android.app.Activity; 20 | import android.content.Context; 21 | import android.view.LayoutInflater; 22 | import android.view.View; 23 | import android.view.ViewGroup; 24 | import android.widget.ArrayAdapter; 25 | import android.widget.ImageView; 26 | import android.widget.TextView; 27 | 28 | import org.tomasdavid.vehicleroutingproblem.R; 29 | 30 | import java.util.List; 31 | 32 | /** 33 | * Adapter for statistic items of navigation drawer. 34 | * 35 | * @author Tomas David 36 | */ 37 | public class StatisticsListAdapter extends ArrayAdapter { 38 | 39 | /** 40 | * Adapter context. 41 | */ 42 | private Context context; 43 | 44 | /** 45 | * List of statistic items. 46 | */ 47 | private List statisticItems; 48 | 49 | /** 50 | * Constructor for statistics list adapter. 51 | * @param context Adapter context. 52 | * @param statisticItems List of statistic items. 53 | */ 54 | public StatisticsListAdapter(Context context, List statisticItems) { 55 | super(context, R.layout.item_statistic, statisticItems); 56 | this.context = context; 57 | this.statisticItems = statisticItems; 58 | } 59 | 60 | /** 61 | * {@inheritDoc} 62 | */ 63 | @Override 64 | public View getView(int position, View convertView, ViewGroup parent) { 65 | LayoutInflater inflater = ((Activity)context).getLayoutInflater(); 66 | 67 | // sets parameters of row 68 | View rowView = inflater.inflate(R.layout.item_statistic, null, true); 69 | ImageView image = (ImageView) rowView.findViewById(R.id.item_statistic_image); 70 | TextView name = (TextView) rowView.findViewById(R.id.item_statistic_name); 71 | TextView value = (TextView) rowView.findViewById(R.id.item_statistic_value); 72 | image.setImageResource(statisticItems.get(position).getImageResId()); 73 | name.setText(statisticItems.get(position).getName()); 74 | value.setText(statisticItems.get(position).getValue()); 75 | 76 | return rowView; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /app/src/main/java/org/tomasdavid/vehicleroutingproblem/adapters/VrpFileItemViewHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Tomas David 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.tomasdavid.vehicleroutingproblem.adapters; 18 | 19 | import android.os.Bundle; 20 | import android.support.v4.app.FragmentActivity; 21 | import android.support.v7.widget.RecyclerView; 22 | import android.view.View; 23 | import android.widget.TextView; 24 | 25 | import org.tomasdavid.vehicleroutingproblem.R; 26 | import org.tomasdavid.vehicleroutingproblem.VrpKeys; 27 | import org.tomasdavid.vehicleroutingproblem.fragments.VrpFragment; 28 | 29 | /** 30 | * Vrp file item view holder for vrp list of files. 31 | * 32 | * @author Tomas David 33 | */ 34 | public class VrpFileItemViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { 35 | 36 | /** 37 | * File text view. 38 | */ 39 | private TextView fileTextView; 40 | 41 | /** 42 | * Vrp file list adapter. 43 | */ 44 | private VrpFileListAdapter adapter; 45 | 46 | /** 47 | * Constructor of file item holder. 48 | * @param itemView File text view. 49 | * @param adapter Vrp file list adapter. 50 | */ 51 | public VrpFileItemViewHolder(View itemView, VrpFileListAdapter adapter) { 52 | super(itemView); 53 | this.fileTextView = (TextView) itemView.findViewById(R.id.vrp_file_item); 54 | this.adapter = adapter; 55 | itemView.setOnClickListener(this); 56 | } 57 | 58 | /** 59 | * Returns file text view. 60 | * @return File text view 61 | */ 62 | public TextView getFileTextView() { 63 | return fileTextView; 64 | } 65 | 66 | /** 67 | * {@inheritDoc} 68 | */ 69 | @Override 70 | public void onClick(View v) { 71 | 72 | // add values to bundle 73 | Bundle bundle = new Bundle(); 74 | bundle.putInt(VrpKeys.VRP_TIME_LIMIT.name(), adapter.getTimeLimit()); 75 | bundle.putString(VrpKeys.VRP_ALGORITHM.name(), adapter.getAlgorithm()); 76 | bundle.putString(VrpKeys.VRP_FILE_NAME.name(), adapter.getVrpFileNames()[getLayoutPosition()]); 77 | 78 | // start vrp fragment 79 | VrpFragment fragment = new VrpFragment(); 80 | fragment.setArguments(bundle); 81 | ((FragmentActivity) v.getContext()).getSupportFragmentManager() 82 | .beginTransaction().replace(R.id.activity_main, fragment).addToBackStack(null).commit(); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /app/src/main/java/org/tomasdavid/vehicleroutingproblem/adapters/VrpFileListAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Tomas David 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.tomasdavid.vehicleroutingproblem.adapters; 18 | 19 | import android.support.v7.widget.RecyclerView; 20 | import android.view.LayoutInflater; 21 | import android.view.ViewGroup; 22 | 23 | import org.tomasdavid.vehicleroutingproblem.R; 24 | 25 | /** 26 | * Adapter of vrp file list. 27 | * 28 | * @author Tomas David 29 | */ 30 | public class VrpFileListAdapter extends RecyclerView.Adapter { 31 | 32 | /** 33 | * Time limit for calculation. 34 | */ 35 | private int timeLimit; 36 | 37 | /** 38 | * Algorithm for calculation. 39 | */ 40 | private String algorithm; 41 | 42 | /** 43 | * Array of vrp files names. 44 | */ 45 | private String[] vrpFileNames; 46 | 47 | /** 48 | * Adapter constructor. 49 | * @param vrpFileNames Array of vrp files names. 50 | * @param timeLimit Time limit for calculation. 51 | * @param algorithm Algorithm for calculation. 52 | */ 53 | public VrpFileListAdapter(String[] vrpFileNames, int timeLimit, String algorithm) { 54 | this.vrpFileNames = vrpFileNames; 55 | this.timeLimit = timeLimit; 56 | this.algorithm = algorithm; 57 | } 58 | 59 | /** 60 | * Returns time limit for calculation. 61 | * @return Time limit for calculation. 62 | */ 63 | public int getTimeLimit() { 64 | return timeLimit; 65 | } 66 | 67 | /** 68 | * Returns algorithm for calculation. 69 | * @return Algorithm for calculation. 70 | */ 71 | public String getAlgorithm() { 72 | return algorithm; 73 | } 74 | 75 | /** 76 | * Returns array of vrp files names. 77 | * @return Array of vrp files names. 78 | */ 79 | public String[] getVrpFileNames() { 80 | return vrpFileNames; 81 | } 82 | 83 | /** 84 | * {@inheritDoc} 85 | */ 86 | @Override 87 | public VrpFileItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 88 | return new VrpFileItemViewHolder(LayoutInflater.from(parent.getContext()).inflate( 89 | R.layout.item_vrp_file, parent, false), this); 90 | } 91 | 92 | /** 93 | * {@inheritDoc} 94 | */ 95 | @Override 96 | public void onBindViewHolder(VrpFileItemViewHolder holder, int position) { 97 | holder.getFileTextView().setText(vrpFileNames[position]); 98 | } 99 | 100 | /** 101 | * {@inheritDoc} 102 | */ 103 | @Override 104 | public int getItemCount() { 105 | return vrpFileNames.length; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /app/src/main/java/org/tomasdavid/vehicleroutingproblem/components/AboutAppDialog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Tomas David 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.tomasdavid.vehicleroutingproblem.components; 18 | 19 | import android.app.AlertDialog; 20 | import android.app.Dialog; 21 | 22 | import android.content.DialogInterface; 23 | import android.os.Bundle; 24 | import android.support.annotation.NonNull; 25 | import android.support.v4.app.DialogFragment; 26 | import android.view.LayoutInflater; 27 | 28 | import org.tomasdavid.vehicleroutingproblem.R; 29 | 30 | /** 31 | * Dialog for providing basic information about the application. 32 | * 33 | * @author Tomas David 34 | */ 35 | public class AboutAppDialog extends DialogFragment implements DialogInterface.OnClickListener { 36 | 37 | /** 38 | * OK button text. 39 | */ 40 | private static final String OK = "OK"; 41 | 42 | /** 43 | * Title of dialog. 44 | */ 45 | private static final String TITLE = "About application"; 46 | 47 | /** 48 | * {@inheritDoc} 49 | */ 50 | @NonNull 51 | @Override 52 | public Dialog onCreateDialog(Bundle savedInstanceState) { 53 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 54 | LayoutInflater inflater = getActivity().getLayoutInflater(); 55 | builder.setTitle(R.string.action_about) 56 | .setView(inflater.inflate(R.layout.dialog_info, null)) 57 | .setPositiveButton(OK, this); 58 | return builder.create(); 59 | } 60 | 61 | /** 62 | * {@inheritDoc} 63 | */ 64 | @Override 65 | public void onClick(DialogInterface dialog, int which) { 66 | dialog.cancel(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/org/tomasdavid/vehicleroutingproblem/components/LegendDialog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Tomas David 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.tomasdavid.vehicleroutingproblem.components; 18 | 19 | import android.app.AlertDialog; 20 | import android.app.Dialog; 21 | import android.content.DialogInterface; 22 | import android.os.Bundle; 23 | import android.support.annotation.NonNull; 24 | import android.support.v4.app.DialogFragment; 25 | import android.view.LayoutInflater; 26 | 27 | import org.tomasdavid.vehicleroutingproblem.R; 28 | 29 | /** 30 | * Dialog contains legend to vehicle routing problem. 31 | * 32 | * @author Tomas David 33 | */ 34 | public class LegendDialog extends DialogFragment implements DialogInterface.OnClickListener { 35 | 36 | /** 37 | * OK button text. 38 | */ 39 | private static final String OK = "OK"; 40 | 41 | /** 42 | * Title of dialog. 43 | */ 44 | private static final String TITLE = "Legend"; 45 | 46 | /** 47 | * {@inheritDoc} 48 | */ 49 | @NonNull 50 | @Override 51 | public Dialog onCreateDialog(Bundle savedInstanceState) { 52 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 53 | LayoutInflater inflater = getActivity().getLayoutInflater(); 54 | builder.setTitle(TITLE) 55 | .setView(inflater.inflate(R.layout.dialog_legend, null)) 56 | .setPositiveButton(OK, this); 57 | return builder.create(); 58 | } 59 | 60 | /** 61 | * {@inheritDoc} 62 | */ 63 | @Override 64 | public void onClick(DialogInterface dialog, int which) { 65 | dialog.cancel(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/org/tomasdavid/vehicleroutingproblem/components/OpenFileButton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Tomas David 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.tomasdavid.vehicleroutingproblem.components; 18 | 19 | import android.content.Context; 20 | import android.os.Bundle; 21 | import android.support.v4.app.FragmentActivity; 22 | import android.util.AttributeSet; 23 | import android.view.View; 24 | import android.widget.Button; 25 | import android.widget.NumberPicker; 26 | import android.widget.Spinner; 27 | 28 | import org.tomasdavid.vehicleroutingproblem.R; 29 | import org.tomasdavid.vehicleroutingproblem.VrpKeys; 30 | import org.tomasdavid.vehicleroutingproblem.fragments.VrpFileListFragment; 31 | 32 | /** 33 | * Button for continue to vrp list fragment. 34 | * 35 | * @author Tomas David 36 | */ 37 | public class OpenFileButton extends Button implements View.OnClickListener { 38 | 39 | public OpenFileButton(Context context) { 40 | super(context); 41 | init(); 42 | } 43 | 44 | public OpenFileButton(Context context, AttributeSet attrs) { 45 | super(context, attrs); 46 | init(); 47 | } 48 | 49 | public OpenFileButton(Context context, AttributeSet attrs, int defStyleAttr) { 50 | super(context, attrs, defStyleAttr); 51 | init(); 52 | } 53 | 54 | /** 55 | * Sets onClick listener. 56 | */ 57 | private void init() { 58 | this.setOnClickListener(this); 59 | } 60 | 61 | /** 62 | * {@inheritDoc} 63 | */ 64 | @Override 65 | public void onClick(View v) { 66 | FragmentActivity activity = (FragmentActivity) v.getContext(); 67 | NumberPicker numberPicker = (NumberPicker) activity.findViewById(R.id.timeLimitPicker); 68 | Spinner algSpinner = (Spinner) activity.findViewById(R.id.algorithm_spinner); 69 | 70 | // add setting values to bundle and starts new fragment 71 | Bundle bundle = new Bundle(); 72 | bundle.putInt(VrpKeys.VRP_TIME_LIMIT.name(), numberPicker.getValue()); 73 | bundle.putString(VrpKeys.VRP_ALGORITHM.name(), activity.getResources().obtainTypedArray(R.array.algorithm_files) 74 | .getString(algSpinner.getSelectedItemPosition())); 75 | VrpFileListFragment fragment = new VrpFileListFragment(); 76 | fragment.setArguments(bundle); 77 | activity.getSupportFragmentManager().beginTransaction().replace(R.id.activity_main, fragment) 78 | .addToBackStack(null).commit(); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/src/main/java/org/tomasdavid/vehicleroutingproblem/components/StopSolverDialog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Tomas David 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.tomasdavid.vehicleroutingproblem.components; 18 | 19 | import android.app.AlertDialog; 20 | import android.app.Dialog; 21 | import android.content.DialogInterface; 22 | import android.content.DialogInterface.OnClickListener; 23 | import android.os.Bundle; 24 | import android.support.annotation.NonNull; 25 | import android.support.v4.app.DialogFragment; 26 | import android.support.v4.app.Fragment; 27 | import android.support.v7.widget.Toolbar; 28 | 29 | import org.tomasdavid.vehicleroutingproblem.MainActivity; 30 | import org.tomasdavid.vehicleroutingproblem.R; 31 | import org.tomasdavid.vehicleroutingproblem.fragments.VrpFragment; 32 | 33 | /** 34 | * Stop solver dialog. Displays when solver running and user clicks on the back button. 35 | * 36 | * @author Tomas David 37 | */ 38 | public class StopSolverDialog extends DialogFragment implements OnClickListener { 39 | 40 | /** 41 | * {@inheritDoc} 42 | */ 43 | @NonNull 44 | @Override 45 | public Dialog onCreateDialog(Bundle savedInstanceState) { 46 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 47 | builder.setMessage(R.string.solver_running_message) 48 | .setPositiveButton(R.string.button_ok, this) 49 | .setNegativeButton(R.string.button_cancel, this); 50 | return builder.create(); 51 | } 52 | 53 | /** 54 | * {@inheritDoc} 55 | */ 56 | @Override 57 | public void onClick(DialogInterface dialog, int which) { 58 | if (which == DialogInterface.BUTTON_POSITIVE) { 59 | 60 | // solver is stopped, nav. drawer is hidden and list fragment is displayed 61 | Fragment fragment = getActivity().getSupportFragmentManager().findFragmentById(R.id.activity_main); 62 | if (fragment instanceof VrpFragment) { 63 | ((Toolbar) getActivity().findViewById(R.id.toolbar)).setNavigationIcon(null); 64 | (((VrpFragment) fragment).getVrpSolverTask()).stopTask(); 65 | ((MainActivity) getActivity()).lockDrawer(); 66 | getActivity().onBackPressed(); 67 | } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/java/org/tomasdavid/vehicleroutingproblem/fragments/MainFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Tomas David 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.tomasdavid.vehicleroutingproblem.fragments; 18 | 19 | import android.os.Bundle; 20 | import android.support.v4.app.Fragment; 21 | import android.text.Html; 22 | import android.view.LayoutInflater; 23 | import android.view.Menu; 24 | import android.view.MenuInflater; 25 | import android.view.MenuItem; 26 | import android.view.View; 27 | import android.view.ViewGroup; 28 | import android.widget.ArrayAdapter; 29 | import android.widget.NumberPicker; 30 | import android.widget.Spinner; 31 | import android.widget.TextView; 32 | 33 | import org.tomasdavid.vehicleroutingproblem.components.AboutAppDialog; 34 | import org.tomasdavid.vehicleroutingproblem.components.LegendDialog; 35 | import org.tomasdavid.vehicleroutingproblem.R; 36 | 37 | /** 38 | * Main fragment with settings. 39 | * 40 | * @author Tomas David 41 | */ 42 | public class MainFragment extends Fragment { 43 | 44 | /** 45 | * Default time limit in number picker. 46 | */ 47 | private static final int DEFAULT_TIME_LIMIT = 10; 48 | 49 | /** 50 | * Minimum time limit in number picker. 51 | */ 52 | private static final int MIN_TIME_LIMIT = 1; 53 | 54 | /** 55 | * Maximum time limit in number picker. 56 | */ 57 | private static final int MAX_TIME_LIMIT = 1000; 58 | 59 | /** 60 | * {@inheritDoc} 61 | */ 62 | @Override 63 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 64 | View view = inflater.inflate(R.layout.fragment_main, container, false); 65 | 66 | // time limit number picker initialization 67 | NumberPicker numberPicker = (NumberPicker) view.findViewById(R.id.timeLimitPicker); 68 | numberPicker.setMinValue(MIN_TIME_LIMIT); 69 | numberPicker.setMaxValue(MAX_TIME_LIMIT); 70 | numberPicker.setValue(DEFAULT_TIME_LIMIT); 71 | numberPicker.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS); 72 | 73 | // welcome text 74 | TextView welcomeText = (TextView) view.findViewById(R.id.welcome_text); 75 | welcomeText.setText(Html.fromHtml(getString(R.string.welcome_text))); 76 | 77 | // spinner for choosing algorithm initialization 78 | Spinner algSpinner = (Spinner) view.findViewById(R.id.algorithm_spinner); 79 | ArrayAdapter spinnerAdapter = ArrayAdapter.createFromResource(getActivity(), R.array.algorithms, 80 | android.R.layout.simple_spinner_item); 81 | spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); 82 | algSpinner.setAdapter(spinnerAdapter); 83 | 84 | setHasOptionsMenu(true); 85 | return view; 86 | } 87 | 88 | /** 89 | * {@inheritDoc} 90 | */ 91 | @Override 92 | public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { 93 | inflater.inflate(R.menu.menu_vrp, menu); 94 | 95 | // disable play button 96 | menu.findItem(R.id.action_run).setVisible(false); 97 | 98 | super.onCreateOptionsMenu(menu, inflater); 99 | } 100 | 101 | /** 102 | * {@inheritDoc} 103 | */ 104 | @Override 105 | public boolean onOptionsItemSelected(MenuItem item) { 106 | int id = item.getItemId(); 107 | if (id == R.id.action_about) { 108 | AboutAppDialog aad = new AboutAppDialog(); 109 | aad.show(getActivity().getSupportFragmentManager(), null); 110 | return true; 111 | } else if (id == R.id.action_legend) { 112 | LegendDialog ld = new LegendDialog(); 113 | ld.show(getActivity().getSupportFragmentManager(), null); 114 | return true; 115 | } 116 | return super.onOptionsItemSelected(item); 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /app/src/main/java/org/tomasdavid/vehicleroutingproblem/fragments/VrpFileListFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Tomas David 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.tomasdavid.vehicleroutingproblem.fragments; 18 | 19 | import android.os.Bundle; 20 | import android.support.v4.app.Fragment; 21 | import android.support.v7.widget.LinearLayoutManager; 22 | import android.support.v7.widget.RecyclerView; 23 | import android.view.LayoutInflater; 24 | import android.view.View; 25 | import android.view.ViewGroup; 26 | 27 | import org.tomasdavid.vehicleroutingproblem.R; 28 | import org.tomasdavid.vehicleroutingproblem.VrpKeys; 29 | import org.tomasdavid.vehicleroutingproblem.adapters.VrpFileListAdapter; 30 | 31 | import java.io.IOException; 32 | import java.util.ArrayList; 33 | 34 | /** 35 | * Fragment for displaying list of vrp files. 36 | * 37 | * @author Tomas David 38 | */ 39 | public class VrpFileListFragment extends Fragment { 40 | 41 | /** 42 | * Extension of vrp file. 43 | */ 44 | private static final String VRP_EXTENSION = ".vrp"; 45 | 46 | /** 47 | * {@inheritDoc} 48 | */ 49 | @Override 50 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 51 | View view = inflater.inflate(R.layout.fragment_vrp_file_list, container, false); 52 | 53 | // initialize recycler view 54 | RecyclerView mRecyclerView = (RecyclerView) view.findViewById(R.id.vrp_file_list); 55 | mRecyclerView.setHasFixedSize(true); 56 | mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); 57 | 58 | ArrayList vrpAssets = new ArrayList<>(); 59 | String[] assetsRoot; 60 | 61 | // get all assets 62 | try { 63 | assetsRoot = getActivity().getAssets().list(getActivity().getString(R.string.vrps_dir)); 64 | } catch (IOException e) { 65 | assetsRoot = new String[0]; 66 | } 67 | 68 | // remove files without vrp file extension 69 | for (String asset : assetsRoot) { 70 | if (asset.endsWith(VRP_EXTENSION)) { 71 | vrpAssets.add(asset); 72 | } 73 | } 74 | 75 | // initialize adapter 76 | VrpFileListAdapter mAdapter = new VrpFileListAdapter( 77 | vrpAssets.toArray(new String[vrpAssets.size()]), 78 | getArguments().getInt(VrpKeys.VRP_TIME_LIMIT.name()), 79 | getArguments().getString(VrpKeys.VRP_ALGORITHM.name()) 80 | ); 81 | mRecyclerView.setAdapter(mAdapter); 82 | 83 | return view; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /app/src/main/java/org/tomasdavid/vehicleroutingproblem/painter/VrpTranslator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Tomas David 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.tomasdavid.vehicleroutingproblem.painter; 18 | 19 | import android.content.res.Resources; 20 | 21 | import org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution; 22 | import org.optaplanner.examples.vehiclerouting.domain.location.Location; 23 | import org.tomasdavid.vehicleroutingproblem.R; 24 | 25 | /** 26 | * Class for translation between longitude/latitude and screen coordinate system. 27 | * This file was modified from original file LatitudeLongitudeTranslator.java from OptaPlanner project. 28 | * 29 | * @author Tomas David 30 | * @author Geoffrey De Smet 31 | */ 32 | public class VrpTranslator { 33 | 34 | private double minLatitude = Double.MAX_VALUE; 35 | private double maxLatitude = -Double.MAX_VALUE; 36 | private double minLongitude = Double.MAX_VALUE; 37 | private double maxLongitude = -Double.MAX_VALUE; 38 | 39 | private double latitudeLength = 0.0; 40 | private double longitudeLength = 0.0; 41 | 42 | private double width = 0.0; 43 | private double height = 0.0; 44 | 45 | private double widthMargin = 0.0; 46 | private double heightMargin = 0.0; 47 | 48 | private double scale; 49 | 50 | /** 51 | * Constructor prepares vehicle routing solution for specified screen size. 52 | * @param vrs Vehicle routing solution. 53 | * @param width Width of screen. 54 | * @param height Height of screen. 55 | * @param resources Application resources. 56 | */ 57 | public VrpTranslator(VehicleRoutingSolution vrs, double width, double height, 58 | Resources resources) { 59 | for (Location location : vrs.getLocationList()) { 60 | addCoordinates(location.getLatitude(), location.getLongitude()); 61 | } 62 | 63 | this.widthMargin = resources.getDimension(R.dimen.margin_width); 64 | this.heightMargin = resources.getDimension(R.dimen.margin_height); 65 | 66 | this.width = width - 2.0 * widthMargin; 67 | this.height = height - 2.0 * heightMargin; 68 | 69 | latitudeLength = maxLatitude - minLatitude; 70 | longitudeLength = maxLongitude - minLongitude; 71 | 72 | if (this.width / longitudeLength > this.height / latitudeLength) { 73 | scale = this.height / latitudeLength; 74 | } else { 75 | scale = this.width / longitudeLength; 76 | } 77 | } 78 | 79 | /** 80 | * Add coordinates to find out min/max longitude/latitude. 81 | * @param latitude Point latitude. 82 | * @param longitude Point longitude. 83 | */ 84 | public void addCoordinates(double latitude, double longitude) { 85 | if (latitude < minLatitude) { 86 | minLatitude = latitude; 87 | } 88 | if (latitude > maxLatitude) { 89 | maxLatitude = latitude; 90 | } 91 | if (longitude < minLongitude) { 92 | minLongitude = longitude; 93 | } 94 | if (longitude > maxLongitude) { 95 | maxLongitude = longitude; 96 | } 97 | } 98 | 99 | /** 100 | * Converts point longitude to x coordinate. 101 | * @param longitude Point longitude. 102 | * @return X coordinate on screen. 103 | */ 104 | public float translateLongitudeToX(double longitude) { 105 | return (float) Math.floor(((longitude - minLongitude) * scale) + widthMargin + (width-longitudeLength * scale) / 2.0); 106 | } 107 | 108 | /** 109 | * Converts point latitude to y coordinate. 110 | * @param latitude Point latitude. 111 | * @return Y coordinate on screen. 112 | */ 113 | public float translateLatitudeToY(double latitude) { 114 | return (float) Math.floor(((maxLatitude - latitude) * scale) + heightMargin + (height-latitudeLength * scale) / 2.0); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /app/src/main/java/org/tomasdavid/vehicleroutingproblem/tasks/ProgressBarTask.java: -------------------------------------------------------------------------------- 1 | package org.tomasdavid.vehicleroutingproblem.tasks; 2 | 3 | import android.os.AsyncTask; 4 | import android.support.v4.app.FragmentActivity; 5 | import android.util.Log; 6 | import android.widget.ProgressBar; 7 | 8 | import org.tomasdavid.vehicleroutingproblem.R; 9 | import org.tomasdavid.vehicleroutingproblem.fragments.VrpFragment; 10 | 11 | /** 12 | * Progress bar task for change time progress of progress bar when solver is solving. 13 | * 14 | * @author Tomas David 15 | */ 16 | /* 17 | * Copyright 2015 Tomas David 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * 23 | * http://www.apache.org/licenses/LICENSE-2.0 24 | * 25 | * Unless required by applicable law or agreed to in writing, software 26 | * distributed under the License is distributed on an "AS IS" BASIS, 27 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 28 | * See the License for the specific language governing permissions and 29 | * limitations under the License. 30 | */ 31 | 32 | public class ProgressBarTask extends AsyncTask { 33 | 34 | /** 35 | * Class tag. 36 | */ 37 | private static final String TAG = "ProgressBarTask"; 38 | 39 | /** 40 | * One second = 1000 milliseconds 41 | */ 42 | private static final int SECOND = 1000; 43 | 44 | /** 45 | * Actual progress of progress bar. 46 | */ 47 | private int progress; 48 | 49 | /** 50 | * Vrp fragment where progress bar is placed. 51 | */ 52 | private VrpFragment fragment; 53 | 54 | /** 55 | * Constructor of progress bar task. 56 | * @param fragment Vrp fragment where progress bar is placed. 57 | */ 58 | public ProgressBarTask(VrpFragment fragment) { 59 | this.fragment = fragment; 60 | this.progress = 0; 61 | } 62 | 63 | /** 64 | * {@inheritDoc} 65 | */ 66 | @Override 67 | protected Void doInBackground(Integer... params) { 68 | 69 | // initialize progress bar 70 | progress = 0; 71 | ProgressBar progressBar = (ProgressBar) fragment.getActivity().findViewById(R.id.progress_bar); 72 | progressBar.setProgress(progress); 73 | 74 | // while solver task is running change progress every 1 second 75 | while (fragment.getVrpSolverTask().isRunning() && progress < progressBar.getMax()) { 76 | try { 77 | Thread.sleep(SECOND); 78 | } catch (InterruptedException e) { 79 | Log.e(TAG, "Thread sleep error.", e); 80 | } 81 | 82 | if (fragment != null) { 83 | FragmentActivity activity = fragment.getActivity(); 84 | if (activity != null) { 85 | progressBar = (ProgressBar) activity.findViewById(R.id.progress_bar); 86 | if (progressBar != null) { 87 | progressBar.incrementProgressBy(1); 88 | } 89 | } 90 | } 91 | progress++; 92 | } 93 | 94 | return null; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/depot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-hdpi/depot.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_help_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-hdpi/ic_help_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_info_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-hdpi/ic_info_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_menu_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-hdpi/ic_menu_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_more_vert_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-hdpi/ic_more_vert_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_play_arrow_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-hdpi/ic_play_arrow_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_stop_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-hdpi/ic_stop_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/vehicle_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-hdpi/vehicle_blue.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/vehicle_brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-hdpi/vehicle_brown.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/vehicle_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-hdpi/vehicle_green.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/vehicle_orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-hdpi/vehicle_orange.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/vehicle_purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-hdpi/vehicle_purple.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/vehicle_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-hdpi/vehicle_red.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/vehicle_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-hdpi/vehicle_yellow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/depot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-mdpi/depot.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_help_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-mdpi/ic_help_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_info_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-mdpi/ic_info_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_menu_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-mdpi/ic_menu_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_more_vert_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-mdpi/ic_more_vert_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_play_arrow_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-mdpi/ic_play_arrow_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_stop_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-mdpi/ic_stop_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/vehicle_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-mdpi/vehicle_blue.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/vehicle_brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-mdpi/vehicle_brown.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/vehicle_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-mdpi/vehicle_green.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/vehicle_orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-mdpi/vehicle_orange.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/vehicle_purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-mdpi/vehicle_purple.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/vehicle_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-mdpi/vehicle_red.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/vehicle_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-mdpi/vehicle_yellow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/depot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xhdpi/depot.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_help_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xhdpi/ic_help_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_info_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xhdpi/ic_info_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_menu_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xhdpi/ic_menu_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_more_vert_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xhdpi/ic_more_vert_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_play_arrow_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xhdpi/ic_play_arrow_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_stop_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xhdpi/ic_stop_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/vehicle_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xhdpi/vehicle_blue.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/vehicle_brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xhdpi/vehicle_brown.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/vehicle_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xhdpi/vehicle_green.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/vehicle_orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xhdpi/vehicle_orange.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/vehicle_purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xhdpi/vehicle_purple.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/vehicle_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xhdpi/vehicle_red.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/vehicle_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xhdpi/vehicle_yellow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/depot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxhdpi/depot.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_help_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxhdpi/ic_help_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_info_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxhdpi/ic_info_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_menu_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxhdpi/ic_menu_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_more_vert_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxhdpi/ic_more_vert_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_play_arrow_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxhdpi/ic_play_arrow_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_stop_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxhdpi/ic_stop_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/vehicle_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxhdpi/vehicle_blue.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/vehicle_brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxhdpi/vehicle_brown.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/vehicle_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxhdpi/vehicle_green.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/vehicle_orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxhdpi/vehicle_orange.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/vehicle_purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxhdpi/vehicle_purple.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/vehicle_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxhdpi/vehicle_red.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/vehicle_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxhdpi/vehicle_yellow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/depot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxxhdpi/depot.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_help_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxxhdpi/ic_help_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_info_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxxhdpi/ic_info_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_menu_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxxhdpi/ic_menu_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_more_vert_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxxhdpi/ic_more_vert_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_play_arrow_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxxhdpi/ic_play_arrow_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_stop_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxxhdpi/ic_stop_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/vehicle_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxxhdpi/vehicle_blue.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/vehicle_brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxxhdpi/vehicle_brown.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/vehicle_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxxhdpi/vehicle_green.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/vehicle_orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxxhdpi/vehicle_orange.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/vehicle_purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxxhdpi/vehicle_purple.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/vehicle_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxxhdpi/vehicle_red.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/vehicle_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasdavidorg/android-vehicle-routing-problem/ff0ca573513e3856cddb38f4b7c7541b9260c040/app/src/main/res/drawable-xxxhdpi/vehicle_yellow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_customer.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 13 | 14 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_dash_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 12 | 19 | 20 | 25 | 26 | 27 | 28 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_info.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_legend.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 16 | 17 | 21 | 22 | 28 | 29 | 30 | 32 | 33 | 37 | 38 | 44 | 45 | 46 | 48 | 49 | 57 | 58 | 64 | 65 | 66 | 68 | 69 | 75 | 76 | 82 | 83 | 84 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | 17 | 22 | 23 | 28 | 29 | 35 | 36 | 41 | 42 | 43 | 44 | 49 | 50 | 54 | 55 | 61 | 62 | 67 | 68 | 69 | 70 | 75 | 76 | 81 | 82 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_vrp.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_vrp_file_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_statistic.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | 17 | 23 | 24 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_vrp_file.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_vrp.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 17 | 18 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | @drawable/vehicle_red 6 | @drawable/vehicle_green 7 | @drawable/vehicle_blue 8 | @drawable/vehicle_orange 9 | @drawable/vehicle_purple 10 | @drawable/vehicle_brown 11 | @drawable/vehicle_yellow 12 | 13 | 14 | 15 | @color/red 16 | @color/green 17 | @color/blue 18 | @color/orange 19 | @color/purple 20 | @color/brown 21 | @color/yellow 22 | 23 | 24 | 25 | @string/first_fit_decreasing 26 | @string/branch_and_bound 27 | @string/brute_force 28 | 29 | 30 | 31 | @string/first_fit_decreasing_file_name 32 | @string/branch_and_bound_file_name 33 | @string/brute_force_file_name 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #FFFFFF 5 | #000000 6 | #9E9E9E 7 | #BDBDBD 8 | #212121 9 | #607D8B 10 | #D50000 11 | #BF360C 12 | #1B5E20 13 | 14 | #F44336 15 | #795548 16 | #FF9800 17 | #FFEB3B 18 | #4CAF50 19 | #2196F3 20 | #9C27B0 21 | 22 | #AAFFFFFF 23 | #AA9E9E9E 24 | 25 | #1976D2 26 | 27 | #FFFFFFFF 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1dp 5 | 3dp 6 | 7 | 12sp 8 | 10dp 9 | -10dp 10 | 20dp 11 | 12 | 48dp 13 | 150dp 14 | 15 | 48dp 16 | 32dp 17 | 18 | 12dp 19 | 10dp 20 | 14dp 21 | 12dp 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Vehicle Routing Problem 6 | VRP 7 | 8 | 9 | Run 10 | About this application 11 | Legend 12 | 13 | 14 | vrps 15 | 16 | 17 | Solver is running. Do you want to stop the solver? 18 | 19 | 20 | Calculation started. 21 | Calculation finished. 22 | 23 | 24 | Open file 25 | OK 26 | Cancel 27 | 28 | 29 | Vehicle 30 | Depot 31 | Customer with demand 32 | Road to customer 33 | Road to depot 34 | 10 35 | 36 | 37 | 1. Select time limit in seconds 38 | 2. Select algorithm 39 | 3. Continue to select file 40 | 41 | Welcome to the Vehicle Routing Problem application! 43 | Please select time limit in seconds, algorithm for calculation and click on the Open file button. 44 | After that, you can select example of vrp problem to solve. 45 | ]]> 46 | 47 | Author: Tomas David\n\nYear: 2015\n\nThe application demonstrates 48 | OptaPlanner functionality on the Android platform. Demonstration is exemplified by Vehicle 49 | routing problem example. 50 | 51 | 52 | 53 | FFD with LA 54 | Branch and bound 55 | Brute force 56 | 57 | 58 | vrpFirstFitDecreasingSolverConfig.xml 59 | vrpBranchAndBoundSolverConfig.xml 60 | vrpBruteForceSolverConfig.xml 61 | 62 | 63 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 15 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------
Please select time limit in seconds, algorithm for calculation and click on the Open file button. 44 | After that, you can select example of vrp problem to solve.