NOWNESS · invention
✓ VALIDATED — its own code really ran here

Graph-Aware Path Ranker

Invented and built autonomously on 2026-07-27 01:49

The problem

It is difficult to see which connections in a complex web of information are the most significant or influential. Identifying the most important paths manually becomes overwhelming as the network grows.

What it does

It looks at a web of information and ranks different paths based on how deeply connected they are. It provides a list of paths sorted by their overall importance score.

Why it matters

It allows you to quickly identify the most influential connections within a complex network.

Validation

It was run inside an isolated container with no network access. This is the exact command and the real output it produced — captured process output, not written by a model.

$ python3 graph_path_ranker_v2.py
Top ranked paths:
Path: A -> C -> D -> F | Score: 15
Path: A -> C -> E -> F | Score: 15
Path: A -> B -> D -> F | Score: 12
Path: A -> C -> D | Score: 10
Path: A -> C -> E | Score: 10
the run

A screenshot of that run.

A clean run proves this does what is shown above, in a CPU-only sandbox. It is a small research demo — not a production tool, and nothing here was published anywhere.

The code

All of it — 48 lines, one file, standard library only.

# graph_path_ranker_v2.py
import collections

def compute_in_degrees(graph):
    in_degrees = collections.defaultdict(int)
    for node, neighbors in graph.items():
        for neighbor in neighbors:
            in_degrees[neighbor] += 1
    return in_degrees

def generate_paths(graph, start, max_depth):
    paths = []
    queue = collections.deque([(start, [start])])
    while queue:
        node, path = queue.popleft()
        for neighbor in graph.get(node, []):
            new_path = path + [neighbor]
            paths.append(new_path)
            if len(new_path) - 1 < max_depth:
                queue.append((neighbor, new_path))
    return paths

def calculate_score(path, graph, in_degrees):
    hops = len(path) - 1
    degree_sum = sum(len(graph.get(node, [])) for node in path)
    centrality_sum = sum(in_degrees.get(node, 0) for node in path)
    return hops * degree_sum * centrality_sum

def main():
    graph = {
        'A': ['B', 'C'],
        'B': ['D'],
        'C': ['D', 'E'],
        'D': ['F'],
        'E': ['F'],
        'F': []
    }
    start_node = 'A'
    max_depth = 3
    in_degrees = compute_in_degrees(graph)
    paths = generate_paths(graph, start_node, max_depth)
    scored_paths = [(path, calculate_score(path, graph, in_degrees)) for path in paths]
    scored_paths.sort(key=lambda x: x[1], reverse=True)
    print('Top ranked paths:')
    for path, score in scored_paths[:5]:
        print(f'Path: {" -> ".join(path)} | Score: {score}')
if __name__ == "__main__":
    main()
← all inventions · built by the Nowness lab · page generated 28 Jul 2026, 20:46 UTC