| | import os |
| | import sys |
| | import json |
| | import networkx as nx |
| | import matplotlib.pyplot as plt |
| |
|
| | |
| | sys.path.append(os.path.join(os.path.dirname(__file__), "../")) |
| | from app.services.agn_service.build_expanded_graph import build_expanded_graph |
| | from app.services.agn_service.visualize_graph import visualize_graph |
| |
|
| | |
| | index_file_path = "graphs/config.json" |
| | output_image = "expanded_graph_visualization.png" |
| |
|
| | |
| | def load_index_data(file_path): |
| | with open(file_path, "r") as file: |
| | return json.load(file) |
| |
|
| | |
| | if __name__ == "__main__": |
| | |
| | data = load_index_data(index_file_path) |
| |
|
| | |
| | G = build_expanded_graph(data) |
| |
|
| | if G: |
| | visualize_graph(G, output_file=output_image) |
| | print(f"Expanded graph visualization saved as {output_image}") |
| | else: |
| | print("Failed to build expanded graph.") |