Benchmarks for Discrete Optimization

Benchmarks for discrete optimization in Java

License

License

MIT
Categories

Categories

Java Languages Data
GroupId

GroupId

com.github.chen0040
ArtifactId

ArtifactId

java-datasets-discrete-optimization
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Benchmarks for Discrete Optimization
Benchmarks for discrete optimization in Java
Project URL

Project URL

https://github.com/chen0040/java-datasets-discrete-optimization
Source Code Management

Source Code Management

https://github.com/chen0040/java-datasets-discrete-optimization

Download java-datasets-discrete-optimization

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.chen0040/java-datasets-discrete-optimization/ -->
<dependency>
    <groupId>com.github.chen0040</groupId>
    <artifactId>java-datasets-discrete-optimization</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.chen0040/java-datasets-discrete-optimization/
implementation 'com.github.chen0040:java-datasets-discrete-optimization:1.0.1'
// https://jarcasting.com/artifacts/com.github.chen0040/java-datasets-discrete-optimization/
implementation ("com.github.chen0040:java-datasets-discrete-optimization:1.0.1")
'com.github.chen0040:java-datasets-discrete-optimization:jar:1.0.1'
<dependency org="com.github.chen0040" name="java-datasets-discrete-optimization" rev="1.0.1">
  <artifact name="java-datasets-discrete-optimization" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.chen0040', module='java-datasets-discrete-optimization', version='1.0.1')
)
libraryDependencies += "com.github.chen0040" % "java-datasets-discrete-optimization" % "1.0.1"
[com.github.chen0040/java-datasets-discrete-optimization "1.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.20
org.slf4j : slf4j-log4j12 jar 1.7.20
com.github.chen0040 : java-data-frame jar 1.0.11

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.16.6

test (10)

Group / Artifact Type Version
org.testng : testng jar 6.9.10
org.hamcrest : hamcrest-core jar 1.3
org.hamcrest : hamcrest-library jar 1.3
org.assertj : assertj-core jar 3.5.2
org.powermock : powermock-core jar 1.6.5
org.powermock : powermock-api-mockito jar 1.6.5
org.powermock : powermock-module-junit4 jar 1.6.5
org.powermock : powermock-module-testng jar 1.6.5
org.mockito : mockito-core jar 2.0.2-beta
org.mockito : mockito-all jar 2.0.2-beta

Project Modules

There are no modules declared in this project.

java-datasets-discrete-optimization

Package provides datasets in the domain of discrete optimization

Features

  • TSP

Install

Add the following dependency to your POM file:

<dependency>
  <groupId>com.github.chen0040</groupId>
  <artifactId>java-datasets-discrete-optimization</artifactId>
  <version>1.0.1</version>
</dependency>

Usage

TSP

The sample code below shows how to list all the TSP benchmarks:

Tsp.Instance[] instances = Tsp.Instance.values();
      for(Tsp.Instance instance : instances){
         TspBenchmark benchmark = Tsp.get(instance);
      }
}

The sample code belows show how to obtain use the api of a TSP benchmark:

TspBenchmark benchmark = Tsp.get(Tsp.Instance.a280);
System.out.println(benchmark.size());

for(int v = 0; v < benchmark.size(); ++v){
   System.out.println(benchmark.position(v)); // print the (x, y) coordinate of vertex v 
   for(int w = v+1; w < benchmark.size(); ++w) {
      System.out.println(benchmark.distance(v, w)); // symmetric distance between vertices v and w
   }
}

// optTour is the known optimal tour for which the last vertex is connected to the first vertex
for(Integer v : benchmark.optTour()){
   System.out.println(v);
}

System.out.println(benchmark.optCost()); // print the total distance of the known optimal tour

Versions

Version
1.0.1