From 77fca1a5c9669a8397a835801a223001f89327c7 Mon Sep 17 00:00:00 2001 From: SevgiAkten Date: Tue, 13 Aug 2024 11:27:10 +0300 Subject: [PATCH] (#54) remove unnecessary packages --- requirements.txt | 25 ++++++++----------- .../discrete/permutation/tsp.py | 10 +++++--- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/requirements.txt b/requirements.txt index ce4a20f..792a6f9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,27 +1,22 @@ -click==8.1.7 -contourpy==1.2.0 -cycler==0.12.1 -Deprecated==1.2.14 -execnet==2.1.1 -fonttools==4.45.1 geographiclib==2.0 geopy==2.4.1 +grip==4.6.2 iniconfig==2.0.0 -kiwisolver==1.4.5 -matplotlib==3.8.2 -networkx==2.8.8 +Markdown==3.6 +Markdown-Editor==1.0.7 numpy==1.26.2 -packaging==23.2 -pandas==2.1.3 -Pillow==10.1.0 +pandoc==2.3 +path-and-address==2.0.1 pluggy==1.5.0 +plumbum==1.8.3 +ply==3.11 +Pygments==2.18.0 +pymdown-extensions==7.1 pyparsing==3.1.1 pytest==8.3.2 pytest-xdist==3.6.1 python-dateutil==2.8.2 pytz==2023.3.post1 six==1.16.0 -tabulate==0.8.10 tsplib95==0.7.1 -tzdata==2023.3 -wrapt==1.16.0 \ No newline at end of file +tzdata==2023.3 \ No newline at end of file diff --git a/src/problems/single_objective/discrete/permutation/tsp.py b/src/problems/single_objective/discrete/permutation/tsp.py index 9d4888b..52cf236 100644 --- a/src/problems/single_objective/discrete/permutation/tsp.py +++ b/src/problems/single_objective/discrete/permutation/tsp.py @@ -1,7 +1,6 @@ from problems.abstract_problem import AbstractProblem import tsplib95 from math import sqrt -import pandas as pd from geopy.distance import geodesic import os @@ -61,8 +60,13 @@ def f(self, x: list) -> float: node_name = [] for i in range(1, 15): node_name.append(i) - - Dist = pd.DataFrame(temp, columns=node_name, index=node_name) + + Dist = {} + # Creating the dictionary of dictionaries + for i, row_name in enumerate(node_name): + Dist[row_name] = {} + for j, col_name in enumerate(node_name): + Dist[row_name][col_name] = temp[i][j] # objective fitness = 0.0