java-topology/whitepaper/gumyum/dots/complexity.dot
russell@unturf.com db29a08762 undefect. CWE-407 — 92 sites, 42 ecosystems
B&W print-friendly diagrams + tinkerpop-0001 + wave-3 proof sections.
Squash of 94 local commits onto remote master.
2026-03-26 19:48:18 -04:00

76 lines
2.4 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

digraph complexity {
graph [
bgcolor="white"
fontname="Helvetica"
fontsize=10
rankdir=TB
pad=0.3
splines=ortho
nodesep=0.6
ranksep=0.7
]
node [
fontname="Helvetica"
fontsize=8
style=filled
fillcolor="white"
color="black"
penwidth=0.8
shape=box
margin="0.15,0.07"
]
edge [
color="black"
penwidth=0.6
arrowsize=0.4
fontname="Helvetica"
fontsize=7
fontcolor="black"
]
// BEFORE column — dashed border to mark defective
subgraph cluster_before {
label="BEFORE"
fontsize=10
fontcolor="black"
color="black"
penwidth=1.5
style=dashed
b_exp [label="O(E^D)\nexponential\nDependencySorter" penwidth=2.5]
b_cub [label="O(n³)\nscala3 constraint" penwidth=2.0]
b_quad [label="O(n²)\njavac Tarjan\nTypeScript checker\nCreate BFS\n..." penwidth=1.5]
b_med [label="O(n·k)\nbounded defects\ncpython, gcc..." penwidth=0.8]
}
// AFTER column — solid border to mark fixed
subgraph cluster_after {
label="AFTER"
fontsize=10
fontcolor="black"
color="black"
penwidth=1.5
a_lin [label="O(E)\nper isCyclic call\nvisited set"]
a_quad2[label="O(n²)\nscala3 still complex\nbut inner loop O(1)" style="filled,dashed"]
a_lin2 [label="O(V+E)\nTarjan fixed\nArrayDeque BFS"]
a_lin3 [label="O(n)\nbounded + O(1) check"]
}
// Arrows — penwidth encodes speedup magnitude
b_exp -> a_lin [label="add visited set" penwidth=2.0 style=bold]
b_cub -> a_quad2[label="inner O(1)" penwidth=1.2]
b_quad -> a_lin2 [label="Set / ArrayDeque" penwidth=2.0 style=bold]
b_med -> a_lin3 [label="HashSet" penwidth=1.2]
// Speedup labels on right
s1 [label="88x at depth 14\n\u221e at depth 16" shape=plaintext fontsize=8 fontcolor="black"]
s2 [label="— (still O(n²))\nbut bounded" shape=plaintext fontsize=8 fontcolor="black"]
s3 [label="23x at V=800\n401x fewer comparisons" shape=plaintext fontsize=8 fontcolor="black"]
s4 [label="24x typical" shape=plaintext fontsize=8 fontcolor="black"]
a_lin -> s1 [style=invis]
a_quad2-> s2 [style=invis]
a_lin2 -> s3 [style=invis]
a_lin3 -> s4 [style=invis]
}