-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
35 lines (28 loc) · 999 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import bruteforce
import optimized
import space_optimized
BUDGET = "500"
if __name__ == '__main__':
dataset = input(
"Please enter (or copy and paste) the path of the csv-dataset:\n")
budget = ""
while not budget.isdigit():
budget = input(
"What's the budget/max cost? (Press enter for default 500)"
) or BUDGET
budget = int(budget)
algorithm = input(
"Please enter:\n"
"[O] to use the optimized algorithm\n"
"[S] to use the space-optimized algorithm\n"
"[B] to use the bruteforce method\n"
"WARNING! Bruteforce can't be used on files "
"with much more than 20 shares\n"
).lower()
if algorithm == "b":
bruteforce.create_top_profit_list(dataset, budget)
elif algorithm == "s":
space_optimized.create_top_profit_list(dataset, budget)
else:
optimized.create_top_profit_list(dataset, budget)
print("Optimal result files successfully created!")