743 questions
1
vote
1
answer
122
views
Why does this Genetic Algorithm give such bad solutions to a TSP? [closed]
I coded a Genetic Algorithm in Python using the DEAP library to solve a modified TSP problem, where the evaluation function is:
def evaluate(self, individual: list[int]) -> float:
...
1
vote
0
answers
43
views
Distance Decreases After Adding Nodes in the Dataset Randomly
I’m currently solving on the optimizing route in Capacitated Vehicle Routing Problem where initially with 125 (orignal data), the Nearest Neighbor Approach provided optimal solution of 23.51km. ...
0
votes
1
answer
100
views
All source traveling sales person
I have a "small-scale" TSP problem where exact solution can be trivially computed as follows. I am trying to get this to work by spitting out "all source" TSP paths. I don't have ...
1
vote
1
answer
220
views
AddVariableMinimizedbyFinalizer not considered by the solver
I am working on a simple version of the VRP. The problem is very similar to the simplest example of the VRP found on the Google OR-Tools page; the only difference is that while in the example the ...
1
vote
1
answer
93
views
Wrong result in VRP by or-tools with locations only visitable by certain vehicles
I’m working on a rather simple version of the VRP. To the example provided on the OR-Tools website, I’ve added just one constraint. Specifically, there are 3 vehicles: A, B, and C, and 16 locations. ...
0
votes
1
answer
130
views
Infinite loop on path finding algorithm (Hidato Puzzle) [closed]
import random as r
class Node:
def __init__(self):
self.out = []
self.is_on_path = False
self.path_out = None
self.is_source = True
self.label = 0
...
-1
votes
1
answer
73
views
Regarding Optaplanner/tiimefold.ai
I have a use case where I want to assign a salesperson to a list of appointments. Now, these salespeople have to travel from one point to another to reach the appointment location. I am using ...
0
votes
0
answers
203
views
Integrating concorde tsp solver on Windows C++ Visual Studio x64 project
We are attempting to integrate the Concorde TSP solver in our Windows x64 C++ Visual Studio project. We have tried for two days now. Without luck. We don't understand how to do it, or if it is even ...
1
vote
1
answer
102
views
genetic optimizer using pulp library
Is it possible to solve a linear problem using the pulp library to create decision variables and write fitness functions and penalties using the Pypi genetic algorithm library? I have done this, but ...
0
votes
1
answer
125
views
MiniZinc: Getting two outputs for an optimal path in a simple TSP model
I am a student starting with the basics of optimization. Basically when I run my TSP model in MiniZinc (IDE 2.8.5, Gecode 6.3.0), I got two "optimal" paths, but it should be only one, right?
...
0
votes
1
answer
150
views
how to find a path from source to target with necessary points constraint by A star algorithm
Using A star algorithm, it is easy to calculate the shortest path from the source point to target point. What if we add the constraint of necessary points? How to solve it ?
necessary points is a set ...
1
vote
1
answer
90
views
KeyError in nx.algorithms.approximation.traveling_salesman_problem()
I have written a code which generates 10 random graphs and solve the traveling salesman problem using NetworkX. I am getting KeyError: 1.
Following is my code.
import networkx as nx
import matplotlib....
0
votes
0
answers
84
views
Ant Colony Optimization and Genetic Algorithms in Terms of Efficiency in Solving the Traveling Salesman Problem
How could I gather data for an experiment solving the traveling salesman problem by comparing ant colony optimization to genetic algorithms in terms of efficiency? Are there any recommended tools? My ...
0
votes
1
answer
277
views
No solution found even using AddDisjunction in VRP solved with google OR-Tools
I'm trying to implement a particular TSP (VRP with only one vehicle). I've used the standard distance matrix provided in the examples of the VRP on Google OR-Tools page (which has a total of 16 ...
0
votes
0
answers
53
views
Why this variable's value keeps increasing while it should remain a fixed value?
I'm trying to implement A* search algorithm to solve TSP problem.
Here's the code I've written so far:
import heapq
#def kruskal_mst(graph):...
def mst_heuristic(graph, current_city, unvisited_cities):...