11import sys
2+ import os
23from time import perf_counter as time
34from Graph import Graph , compute_mst_and_cost
45from LazyNaivePrims import prims_mst as lazy_naive_prims
@@ -22,6 +23,7 @@ def read_graph(grf):
2223# Checking if input file is specified as command line argument.
2324try :
2425fname = sys .argv [1 ]
26+ print (f"You have chosen the test file \" { fname } \" " )
2527except IndexError :
2628fname = input ("Enter test file name: " )
2729
@@ -34,8 +36,8 @@ def read_graph(grf):
3436exit ()
3537
3638def read_choices ():
37- implementation_choice = input ("Which implementation(s)?\n lazy_naive, eager_naive, binary_heap, or fib_heap: " )
38- display_choice = int (input ("\n How to display MST? 1 . None, \n 2 . Adjacency Matrix, or 3 . Graph Visualization: " ))
39+ implementation_choice = input ("\n Which implementation(s)? \n lazy_naive, eager_naive, binary_heap, or fib_heap \n Enter : " )
40+ display_choice = int (input ("\n How to display MST? \n 1 . None \n 2 . Adjacency Matrix \n 3 . Graph Visualization \n Enter : " ))
3941print ()
4042return implementation_choice , display_choice
4143
@@ -87,6 +89,7 @@ def display_mst(display_choice, grf, adj_mat, precursor, mst, cost):
8789
8890def main ():
8991grf = Graph (representation = "matrix" )
92+ os .system ("clear" )
9093read_graph (grf )
9194adj_mat = grf .graph
9295
@@ -96,4 +99,4 @@ def main():
9699display_mst (display_choice , grf , adj_mat , precursor , mst , cost )
97100
98101if __name__ == "__main__" :
99- main ()
102+ main ()
0 commit comments