Skip to content

Commit

Permalink
optimiser
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhpillai committed Jan 27, 2018
1 parent a372d62 commit d1d8e8c
Show file tree
Hide file tree
Showing 4 changed files with 1,018 additions and 999 deletions.
9 changes: 6 additions & 3 deletions answer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pandas as pd
from sklearn.cluster import KMeans
import numpy as np
import sys


MAX_DELIVERIES = 10
Expand All @@ -11,7 +12,7 @@
PRICE_PER_KM = 0.061
MAX_TIME_PER_TRUCK = 10

TOTAL_CLUSTERS = 40
TOTAL_CLUSTERS = 51


def distance(x1, y1, x2, y2):
Expand Down Expand Up @@ -145,8 +146,6 @@ def answer():
kmeans = KMeans(n_clusters=TOTAL_CLUSTERS, random_state=0)
kmeans.fit(orders_to_cluster)

print(len(orders))

# ans_list = bruteforce(orders)
ans_list = clustered(orders, kmeans)

Expand All @@ -159,4 +158,8 @@ def answer():
writer.writerow(row)


if len(sys.argv) > 1:
TOTAL_CLUSTERS = int(sys.argv[1])


answer()
Loading

0 comments on commit d1d8e8c

Please sign in to comment.