Skip to content

Commit

Permalink
Merge pull request #11 from mogproject/dev
Browse files Browse the repository at this point in the history
Update script
  • Loading branch information
mogproject authored Nov 25, 2023
2 parents 330f7b4 + 4e11995 commit df4db6d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/mw_pace.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@ def bench_cpp(G: nx.Graph) -> tuple[int, float, str]:
return int(lines[0]), float(lines[1])


def bench_one_instance(G: nx.Graph, num_iterations: int = 3):
def bench_one_instance(path: str, num_iterations: int = 3):
G = load_pace_2023(path)
n = G.number_of_nodes()
m = G.number_of_edges()

for _ in range(num_iterations):
mw, elapsed = bench_cpp(G)
print(f'{n},{m},{mw},{elapsed}')
print(f'{path},{n},{m},{mw},{elapsed}')


def read_pace_2023(input: TextIO) -> nx.Graph:
Expand Down Expand Up @@ -99,11 +100,10 @@ def main(args):
args.log_level])

logger.info(f'Started: {SCRIPT_PATH}')
logger.info('Output format: n, m, modular-width, elapsed (sec)')
logger.info('Output format: path, n, m, modular-width, elapsed (sec)')

for path in args.path:
G = load_pace_2023(path)
bench_one_instance(G, 1)
bench_one_instance(path, 1)

logger.info(f'Finished: {SCRIPT_PATH}')

Expand Down

0 comments on commit df4db6d

Please sign in to comment.