Skip to content

Instantly share code, notes, and snippets.

@aialenti
Created December 10, 2019 21:01
Show Gist options
  • Save aialenti/e35acb16cb35ad1050642812e8b5dc8e to your computer and use it in GitHub Desktop.
Save aialenti/e35acb16cb35ad1050642812e8b5dc8e to your computer and use it in GitHub Desktop.
class TSP():
cities = None
santa = None
variables_dict = None
x = None
path = None
def __init__(self, population_lower_bound=10e5 * 3):
cities = pd.read_csv("worldcities.csv")
self.cities = cities.loc[cities["population"] >= population_lower_bound][["city","lat","lng","population"]].reset_index()
# Add Santa's house
santa_df = pd.DataFrame([["Santa's House",66.550331132,25.886996452,10000]], columns=["city","lat","lng","population"])
self.cities = pd.concat([self.cities, santa_df]).reset_index()
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment