From 118b070a010126828f2ba9ba7636ffe793ece1e2 Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Thu, 14 Apr 2022 22:26:25 +0200
Subject: [PATCH] Print properties of graph neatly

Simply printing g displays the address of the graph, which may change
between runs. This was not convenient for the comparison of runs.
---
 segments.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/segments.py b/segments.py
index 1b6f5611..23cc3fee 100755
--- a/segments.py
+++ b/segments.py
@@ -71,7 +71,11 @@ for v in g.vertices():
 t1 = time.perf_counter()
 print(f'Done processing in {t1 - t0:.0f} s')
 t0 = t1
-print("New graph:", g)
+print("New graph:")
+print("Number of vertices:", g.num_vertices())
+print("Number of edges:", g.num_edges())
+print("Internal properties:")
+g.list_properties()
 print(f'Empty nodes: {len(verts_to_del)}. Deleting empty nodes...')
 g.remove_vertex(verts_to_del, fast=True)
 t1 = time.perf_counter()
-- 
GitLab