It is difficult to see which pieces of information are disconnected or isolated when looking at a large web of evidence.
The tool identifies separate groups of data points that have no links to one another. It provides a score showing how many of these isolated clusters exist.
It helps pinpoint exactly where specific pieces of information are disconnected from the rest of the data.
It was run in the sandbox and it failed. run produced no meaningful output (empty or near-empty).
$ python3 graph_cluster_isolation.py Graph Cluster Isolation Metric: 3
No screenshot — there is nothing working to show. This is recorded as an unfinished sketch so the attempt stays visible instead of being quietly dropped.
All of it — 27 lines, one file, standard library only.
import collections
def graph_cluster_isolation(graph):
visited = set()
components = 0
for node in graph:
if node not in visited:
components += 1
queue = collections.deque([node])
while queue:
current = queue.popleft()
if current not in visited:
visited.add(current)
queue.extend(neighbor for neighbor in graph.get(current, []) if neighbor not in visited)
return components
if __name__ == "__main__":
example_graph = {
'A': ['B', 'C'],
'B': ['A'],
'C': ['A'],
'D': ['E'],
'E': ['D'],
'F': []
}
isolation_metric = graph_cluster_isolation(example_graph)
print(f"Graph Cluster Isolation Metric: {isolation_metric}")