Skip to content

Performance Mode in JOpt.TourOptimizer

Introduction

Optimization problems are inherently complex, often demanding substantial computational resources to identify the best possible solution. Performance Mode in JOpt.TourOptimizer offers a way to accelerate the optimization process by streamlining certain internal operations.

Enabling Performance Mode can make optimization run up to 50% faster, making it particularly well-suited for large-scale problems with fewer constraints and long working hours. However, this speed gain comes with a trade-off - reducing variation in the solution space, which can lead to slower convergence and potentially less optimal results in highly constrained scenarios.


Overview


What is Performance Mode?

Performance Mode is a faster optimization strategy that reduces the number of concurrent solutions being evaluated in the genetic evolution process and deactivates certain operators throughout the optimization run.

  • Reducing the population size, meaning fewer potential solutions are considered simultaneously.
  • Deactivating several optimization operators, which normally help refine the solution.

This mode is best suited for scenarios where the optimization problem is not heavily constrained and allows more flexibility in scheduling.

Example

Please visit our GitHub-Page for Performance Mode Examples.

(If you are new to JOpt-TourOptimizer, please also read our page on setting up your first optimization.)


How it Works

When Performance Mode is activated, the optimizer makes the following changes:

Reduced Population Size

  • The optimizer cuts the population size in half, meaning fewer solution candidates are processed at the same time.
  • This allows faster computations but may lead to less variation in solutions and slower convergence.

Deactivating Several Optimization Operators

  • The following advanced optimization operators are disabled:
    • Single2OptOperator
    • RecombineOptimizationElementsOperator2
    • RecombineOptimizationElementsOperator3
    • InversionOperator
    • ReciprocalExchangeOperator
    • RouteSeedOperator
    • DoubleRouteRandomizeOperator
    • DisplacementOperator
  • These operators normally introduce variation into the optimization process, helping to explore different potential solutions.
  • Disabling them increases speed but may limit the optimizer's ability to find highly complex solutions.

Faster Processing

  • With a smaller population size and fewer optimization operations, the optimizer requires less computation.
  • This results in up to 50% faster processing.

When to Use Performance Mode

Performance Mode is not ideal for all optimization scenarios. It is best suited for:

  • Low-restriction problems: Few constraints like time windows, skill requirements, or zone codes.
  • Long opening hours: When resources have flexible schedules, reducing the need for fine-grained optimizations.
  • Large-scale optimizations: When processing a high number of nodes and a slightly suboptimal solution is acceptable.
  • Scenarios prioritizing speed over absolute precision.

When NOT to Use Performance Mode

  • Highly constrained problems: If the solution requires strict time windows, skill matching, or geographic territories, Performance Mode might not provide the best results.
  • When absolute optimality is required: If finding the best possible solution is more important than speed, Performance Mode should be avoided.

How to Enable Performance Mode

Performance Mode is disabled by default. To activate it, simply set the following property:

props.setProperty("JOpt.PerformanceMode", "true");

Example: Configuring Performance Mode

To enable Performance Mode, you can modify the optimizer's properties as follows:

private static void addProperties(IOptimization opti, boolean usePerformanceMode) {

    Properties props = new Properties();

    props.setProperty("JOptExitCondition.JOptGenerationCount", "100000"); // High iteration count
    props.setProperty("JOpt.Algorithm.PreOptimization.SA.NumIterations", "100000000"); // High number of iterations
    props.setProperty("JOpt.Algorithm.PreOptimization.SA.NumRepetions", "1");
    props.setProperty("JOpt.NumCPUCores", "4");

    // Enable Performance Mode
    props.setProperty("JOpt.PerformanceMode", ""+usePerformanceMode);

    opti.addElement(props);
}
Setting JOpt.PerformanceMode = true will activate Performance Mode.
Setting it to false (default) will use the standard optimization process.


Performance Trade-offs

Performance Mode provides significant speed improvements, but it also comes with some trade-offs:

Feature Standard Mode Performance Mode
Processing Speed Normal Up to 50% Faster
Optimization Accuracy High Reduced
Handling Complex Constraints Good Limited
Geographical Optimization Precise Less Optimized

Performance Mode Example Evaluation

To assess the impact of Performance Mode, we conducted a series of optimization runs under controlled conditions. The problem setup consisted of:

  • 2000 Nodes and 40 Resources,
  • Skill Matching enabled: Affecting 1000 out of 2000 Nodes
  • Skill Matching enabled: 13 out of 40 Resources providing the required skill

All runs were executed on an Intel i7-1185G7 processor, ensuring consistent computational performance.

The primary variable in our tests was the number of iterations in the genetic phase, while all other settings, including problem size and constraints, remained constant. The results measured the total optimization time (inculding warm-up, construction and simulated annealing) required for different configurations of Performance Mode and Skill Matching.

Graph 1: Execution Time Across Configurations

The first graph presents execution time variations between different configurations: - Performance Mode: Active vs. Inactive
- Skill Matching: Active vs. Inactive

Screenshot
Graph 1

Solid lines indicate cases where Skill Matching was inactive, while dashed lines correspond to runs where Skill Matching was active. The results show that enabling Performance Mode significantly reduces execution time.

Graph 2: Performance Boost Analysis

The second graph illustrates the relative speedup achieved with Performance Mode created by pairwise dividing the curves from Graph 1.
- The blue dashed line represents runs with Skill Matching enabled.
- The red solid line represents runs without Skill Matching.

Screenshot
Graph 2

The y-axis is scaled between 1.4 and 1.8, indicating the performance boost compared to standard optimization. Despite achieving up to 1.7x faster execution, Performance Mode retained approximately 95% of the solution quality when compared to the standard mode, demonstrating its efficiency for large-scale problems with relaxed constraints.

These findings suggest that Performance Mode is highly effective for scenarios prioritizing speed, while still maintaining an acceptable optimization quality.


Closing Words

Performance Mode is an excellent feature for speeding up optimizations, especially in large-scale scenarios with fewer constraints. However, it is important to understand the trade-offs - faster does not always mean better.

If your optimization problem requires complex scheduling, strict constraints, or high precision, Performance Mode may not be ideal. However, if you need fast results with acceptable quality, this feature can significantly improve performance.


Key Takeaways

  • Performance Mode increases optimization speed by up to 50%.
  • It reduces population size and disables advanced optimization operators.
  • Best for large-scale optimizations with fewer constraints.
  • Enable it using JOpt.PerformanceMode = true in the optimizer properties.
  • Use with caution for problems requiring highly optimized solutions.

Authors

A product by DNA Evolutions ©.