Experiments API
The Experiments API provides the problem definitions and data handling functionality.
Built-in Experiments
JuLS.KnapsackExperiment
— TypeKnapsackExperiment <: Experiment
Represents a 0-1 Knapsack Problem experiment instance.
Fields
input_file::String
: Path to file containing problem dataα::Float64
: Penalty parameter for constraint violationn_items::Int
: Number of itemscapacity::Int
: Knapsack capacityvalues::Vector{Int}
: Values of itemsweights::Vector{Int}
: Weights of items
File Format
Expected input file format:
nitems capacity value1 weight1 value2 weight2 ... valuen weight_n
JuLS.TSPExperiment
— TypeTSPExperiment <: Experiment
Represents a Traveling Salesman Problem (TSP) experiment instance.
Fields
input_file::String
: Path to file containing city coordinatesn_nodes::Int
: Number of citiesdistance_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.
JuLS.GraphColoringExperiment
— TypeGraphColoringExperiment <: Experiment
Represents a Graph Coloring Problem experiment instance.
Fields
input_file::String
: Path to file containing problem datamax_color::Int
: Maximum number of color for this problemα::Float64
: Penalty parameter for constraint violationn_nodes::Int
: Number of nodesn_edges::Int
: Number of edgesgreedy_coloring::Vector{Int}
: Coloration with greedy algorithmedges::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)
Experiment Interface
All experiments must implement the following interface:
n_decision_variables(experiment)
: Return the number of decision variablesdecision_type(experiment)
: Return the type of decision variablesgenerate_domains(experiment)
: Return the domains for each variablecreate_dag(experiment)
: Return the DAG representation of the problem