Skip to content

Commit ce55ee0

Browse files
Remove unused code
1 parent 813b368 commit ce55ee0

1 file changed

Lines changed: 0 additions & 18 deletions

File tree

src/export-callgraph-graphviz.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ def get_or_create_node(node_id, slotcount, slotidx):
105105
break
106106

107107
# Calculate total slot counts for edges
108-
# total_slot_count_from_nodes = sum(n["SlotCount"] for n in G.nodes().values())
109108
total_slot_count_from_edges = sum(e["SlotCount"] for e in G.edges().values())
110109

111110
# Add attributes to nodes and edges for DOT output
@@ -147,20 +146,3 @@ def get_or_create_node(node_id, slotcount, slotidx):
147146
out_filename_without_ext = splitext(sys.argv[1])[0]
148147
write_dot(G, out_filename_without_ext + ".dot")
149148
nx.nx_agraph.to_agraph(G).draw(path=out_filename_without_ext + ".svg", prog='dot',format='svg')
150-
151-
# print all simple paths in the graph
152-
paths = []
153-
for source in G.nodes:
154-
for target in G.nodes:
155-
if source != target:
156-
for path in nx.all_simple_paths(G, source=source, target=target):
157-
# get the total weight of the path and print it
158-
# print(" -> ".join(path) + f" SlotCount: {nx.path_weight(G, path, weight='SlotCount')}")
159-
# append the path, and it's length to a list
160-
paths.append((path, nx.path_weight(G, path, weight='SlotCount')))
161-
162-
# sort the paths by length, descending, and print the top 2
163-
paths.sort(key=lambda x: x[1], reverse=True)
164-
print("\nTop 2 longest paths:")
165-
for path, length in paths[:2]:
166-
print(" -> ".join(path) + f" Length: {length}")

0 commit comments

Comments
 (0)