Experiments API

The Experiments API provides the problem definitions and data handling functionality.

Built-in Experiments

JuLS.KnapsackExperimentType
KnapsackExperiment <: Experiment

Represents a 0-1 Knapsack Problem experiment instance.

Fields

  • input_file::String: Path to file containing problem data
  • α::Float64: Penalty parameter for constraint violation
  • n_items::Int: Number of items
  • capacity::Int: Knapsack capacity
  • values::Vector{Int}: Values of items
  • weights::Vector{Int}: Weights of items

File Format

Expected input file format:

nitems capacity value1 weight1 value2 weight2 ... valuen weight_n

source
JuLS.TSPExperimentType
TSPExperiment <: Experiment

Represents a Traveling Salesman Problem (TSP) experiment instance.

Fields

  • input_file::String: Path to file containing city coordinates
  • n_nodes::Int: Number of cities
  • distance_matrix::Matrix{Float64}: Matrix of pairwise distances between cities. The distance is L2 rounded to the closest integer.

File Format

Expected input file format:

n_nodes x1 y1 x2 y2 ... xn yn

Where (xi,yi) are coordinates of city i.

source
JuLS.GraphColoringExperimentType
GraphColoringExperiment <: Experiment

Represents a Graph Coloring Problem experiment instance.

Fields

  • input_file::String: Path to file containing problem data
  • max_color::Int: Maximum number of color for this problem
  • α::Float64: Penalty parameter for constraint violation
  • n_nodes::Int: Number of nodes
  • n_edges::Int: Number of edges
  • greedy_coloring::Vector{Int}: Coloration with greedy algorithm
  • edges::Vector{Tuple{Int,Int}}: List of edges

File Format

Expected input file format:

nnodes nedges node11 node12 (edge 1) node21 node22 (edge 2) ... noden1 noden2 (edge n)

source

Experiment Interface

All experiments must implement the following interface:

  • n_decision_variables(experiment): Return the number of decision variables
  • decision_type(experiment): Return the type of decision variables
  • generate_domains(experiment): Return the domains for each variable
  • create_dag(experiment): Return the DAG representation of the problem