744 questions
1
vote
1
answer
88
views
Why does this Genetic Algorithm give such bad solutions to a TSP?
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:
...
0
votes
1
answer
91
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
67
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. ...
-1
votes
1
answer
63
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 ...
1
vote
1
answer
90
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
137
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 ...
0
votes
0
answers
73
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
0
answers
45
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):...
0
votes
0
answers
338
views
Solving the Travelling Salesman Problem by Ant Colony Optimisation
I am currently attempting to implement the Travelling Salesman Problem via the Ant Colony Optimisation Algorithm. I cannot say that I have a good grasp of the algorithm on an intuitive level, but ...
0
votes
1
answer
178
views
Determining Eulerian Cycle in Multigraph for Christofides Algorithm
I'm implementing the Christofides algorithm for solving the Traveling Salesman Problem and have reached the step where I need to find an Eulerian cycle in a multigraph. I'm unsure how to proceed when ...
1
vote
1
answer
262
views
Parallelizing Traveling Salesman Problem Code in C using OpenMP
I have a C code that solves the Traveling Salesman Problem using a greedy algorithm. However, the current implementation is sequential, and I'd like to parallelize it using OpenMP to achieve better ...
2
votes
0
answers
205
views
How to approach this optimization/scheduling problem? (Similar to Traveling Salesman Problem)
I have a mathematical/computational problem that I think some of you might be able to help me with. It is a planning/scheduling problem involving states, tasks, and resources.
For simplicity, let's ...
1
vote
1
answer
345
views
How to extend TSP to MTSP using Pulp
We've studied TSP and now we're tasked to extend it for multiple salespersons.
Below code using PULP with my added logic which unfortunately does not work. It does not correctly identify the correct ...
0
votes
0
answers
105
views
Constructing result for given word's order and overlapping in Shortest Superstring Problem
For over 3 days I'm trying to solve Shortest Superstring problem and I still can't figure out how can I create resulting string when I know in what order should I use given words and how these words ...
0
votes
1
answer
138
views
Variation of TSP which needs to visit only a set of cities but can visit cities outside the set if necessary
I need to solve a variation of TSP where nodes represent neighborhoods. Neighborhoods can be central or non-central. Starting from a non-central neighborhood I need to find the shortest path that ...
0
votes
1
answer
287
views
TSP with CP-SAT: How to set certain node-visits at specific time
I am solving a TSP with CP-SAT as shown in https://github.com/google/or-tools/blob/master/examples/python/tsp_sat.py, but i have some constraints that i am not able to formulate:
I have some "...
0
votes
0
answers
46
views
Traveling Salesman Problem - Eliminating Subtours?
I'm trying to optimize a road trip across the U.S. in an iJulia notebook. I'm currently having issues with subtours. Instead of creating one fluid trip, the solution jumps around from place to place. ...
0
votes
1
answer
401
views
Defining the linear programming constraints in the Traveling Salesman Problem (TSP) for the scipy.optimize.linprog Python function
I am trying to solve the Linear Programming formulation of the Traveling Salesman Problem (TSP) using scipy.optimize.linprog in Python.
This document clearly defines the problem and, though I ...
1
vote
0
answers
236
views
Dummy node for TSP and finding shortest Hamiltonian Path
Can anyone provide assistance to the problem I'm facing? I'm working on implementing a delivery system algorithm. I have attempted to solve it using a graph, where addresses are represented as nodes ...
1
vote
1
answer
64
views
TSP with only one key to identify a road
I need to solve Traveling Salesman Problem in Python using PuLP.
import pulp
import numpy as np
import matplotlib.pyplot as plt
n = 50
np.random.seed(42)
x = 1.5*np.random.rand(n)
y = np.random.rand(...
1
vote
0
answers
82
views
OR Tools taking infinite time for MVRP
I am trying to solve MVRP problem using Google OR-Tools where I have 1000 points and 30 fleets(Vehicles). This seems to take indefinite amount of time but when I am reducing the fleets(vehicles) to 1 ...
1
vote
0
answers
38
views
JavaScript/JQuery - Object property values are changing when looping through them
We are attempting to create a routing (TSP) algorithm that loops through a data structure that holds our vehicles and our trip information.
It all starts with an ASYNC function called acquireData that ...
0
votes
1
answer
215
views
tidying igraph plot and routing or TSP question
I have less experience in R and I need help tidying my plot as it looks messy. Also, my project is to find the best minimal route from Seoul to every city and back to Seoul. It is almost like ...
1
vote
0
answers
132
views
Pulp creates LpProblem as a NoneType
I'm currently studying TSP formulations using Pulp in Python. Originally, I was using three different point sets with 29, 38 and 194 cities, and the code solved them pretty well and even got the ...
0
votes
1
answer
452
views
Christofides TSP; let start and end node be those that are the farthest apart
I'm using Christofides algorithm to calculate a solution for a Traveling Salesman Problem. The implementation is the one integrated in networkx library for Python.
The algorithm accepts an undirected ...