You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 18, 2026. It is now read-only.
ALGORITHMS.md was missing entries for nearly a third of the implemented analyzers (the running gap between code and docs had grown to 19 of 58 classes). Filled in: KTruss, RichClub, Bipartite, CliqueCover, PerfectGraph, SmallWorld, GraphRegularity, GraphNeighborhood, GraphLabeling, MetricDimension, GraphSymmetry, GraphDrawingQuality, GraphClusterQuality, NodeSimilarity, LineGraph, GraphComplement, GraphMinor, GraphSparsification, Tournament. Added two new top-level categories (Graph Transformation & Construction, Special Graph Classes) so transformation/special-class analyzers have a natural home instead of being orphaned. Updated TOC and refreshed the complexity-summary table to include the new categories and the previously-missed analyzers (small-world, regularity, perfect, etc.). Each new entry follows the established schema: file, complexity, algorithm description with citations to underlying theorems (Konig, Strong Perfect Graph Theorem, Watts-Strogatz, etc.), and use cases.
@@ -117,6 +119,18 @@ A comprehensive reference for all graph algorithms implemented in GraphVisual, o
117
119
-**Complexity:** O(V + E)
118
120
-**Algorithm:** Finds maximal subsets of vertices where every vertex is reachable from every other vertex (in directed graphs). Used for condensation DAG construction.
119
121
122
+
### K-Truss Decomposition
123
+
-**File:**`KTrussAnalyzer.java`
124
+
-**Complexity:** O(m · t_max) edge-peeling, where m = |E| and t_max is the maximum truss number
125
+
-**Algorithm:** Iteratively removes edges whose triangle support drops below (k − 2) and assigns each removed edge its highest surviving k. A k-truss is a maximal subgraph in which every edge belongs to at least (k − 2) triangles, giving a more cohesive notion of community than k-core. Returns the truss number per edge, the hierarchy of (k+1)-truss ⊂ k-truss subgraphs, and the global maximum truss.
126
+
-**Use cases:** Cohesive subgroup detection in social networks, robust community cores, hierarchical clustering by triangle density.
127
+
128
+
### Rich-Club Analysis
129
+
-**File:**`RichClubAnalyzer.java`
130
+
-**Complexity:** O(V + E) per coefficient; O(R · (V + E)) for normalisation with R randomised rewirings
131
+
-**Algorithm:** Computes the rich-club coefficient φ(k) = 2·E>k / (N>k·(N>k − 1)), the density of edges among nodes of degree > k. A rich-club ordering occurs when φ(k) increases with k. Normalised coefficient ρ(k) = φ(k) / φ_rand(k) is obtained by degree-preserving random rewiring of the input graph; ρ(k) > 1 indicates a genuine rich-club beyond what degree distribution alone explains.
132
+
-**Use cases:** Hub-of-hubs detection in air-traffic and brain networks, identifying preferential interconnection among elite nodes, distinguishing real rich-clubs from degree-sequence artefacts.
133
+
120
134
### Graph Resilience (Attack Simulation)
121
135
-**File:**`GraphResilienceAnalyzer.java`
122
136
-**Complexity:** O(V × (V + E))
@@ -136,6 +150,18 @@ A comprehensive reference for all graph algorithms implemented in GraphVisual, o
136
150
-**Complexity:** O(E × √V)
137
151
-**Algorithm:** For bipartite graphs: BFS layering + DFS augmenting paths. Also computes minimum vertex cover (König's theorem) and maximum independent set (complement of vertex cover).
-**Complexity:** O(V + E) for bipartiteness; cached Hopcroft–Karp matching reused across queries
156
+
-**Algorithm:** BFS 2-colouring across all components determines bipartiteness and yields the left/right partition. On a positive result the cached Hopcroft–Karp matching feeds König-based minimum vertex cover and maximum independent set. On a negative result, an odd-cycle witness is reported for diagnostics.
157
+
-**Use cases:** Assignment problems, scheduling, recommendation graphs, bipartite community detection, fast acceptance tests before invoking bipartite-only algorithms.
-**Algorithm:** Partitions vertices into the minimum number of vertex-disjoint cliques. Uses the duality θ(G) = χ(Ḡ) (chromatic number of the complement) for a lower bound, plus a greedy heuristic that repeatedly extracts the largest clique containing the least-covered vertex. Returns the partition, per-clique sizes, and quality vs the lower bound.
163
+
-**Use cases:** Compact graph encoding, register-allocation analogues, scheduling problems where vertices must share a clique, complement-based colouring.
164
+
139
165
### Minimum Vertex Cover (Greedy Approximation)
140
166
-**File:**`VertexCoverAnalyzer.java`
141
167
-**Complexity:** O(V + E) for 2-approximation
@@ -165,6 +191,12 @@ A comprehensive reference for all graph algorithms implemented in GraphVisual, o
165
191
-**Complexity:** O(V + E) for recognition
166
192
-**Algorithm:** Maximum cardinality search (MCS) for perfect elimination ordering (PEO). If a PEO exists, the graph is chordal. Provides optimal coloring, maximum clique, and minimum fill-in for chordal graphs.
167
193
194
+
### Perfect Graph Analysis
195
+
-**File:**`PerfectGraphAnalyzer.java`
196
+
-**Complexity:** O(V⁵) brute-force odd-hole search (small graphs); polynomial recognition for known sub-classes (bipartite, chordal)
197
+
-**Algorithm:** A graph is *perfect* iff χ(H) = ω(H) for every induced subgraph H. By the Strong Perfect Graph Theorem (Chudnovsky–Robertson–Seymour–Thomas, 2006), this holds iff neither G nor Ḡ contains an odd hole (induced odd cycle ≥ 5). Searches for odd holes in G and the complement, reports witness cycles, and recognises common perfect sub-classes (bipartite, chordal, comparability) for fast positive answers.
198
+
-**Use cases:** Polynomial-time colouring and clique algorithms whenever perfection is established, theoretical analysis of social and scheduling graphs.
199
+
168
200
### Planarity Testing
169
201
-**File:**`PlanarGraphAnalyzer.java`
170
202
-**Complexity:** O(V + E)
@@ -258,6 +290,54 @@ A comprehensive reference for all graph algorithms implemented in GraphVisual, o
258
290
-**Complexity:** O(V + E)
259
291
-**Algorithm:** Structural balance theory — checks if a signed graph (positive/negative edges) satisfies balance conditions. Detects frustrated cycles and computes frustration index.
260
292
293
+
### Small-World Network Analysis
294
+
-**File:**`SmallWorldAnalyzer.java`
295
+
-**Complexity:** O(V·(V + E)) (BFS from each vertex for average path length dominates)
296
+
-**Algorithm:** Tests Watts–Strogatz small-world properties by combining local/global clustering coefficients and characteristic path length against random and lattice baselines. Reports σ = (C/Cr)/(L/Lr) and ω = Lr/L − C/Cl, then classifies the network as Small-World, Random-Like, Lattice-Like, or Disconnected. Handles disconnected graphs by restricting path-length computations to the largest connected component.
-**Algorithm:** Determines whether a graph is k-regular and quantifies departure from regularity. Computes the Albertson irregularity index Σ|deg(u) − deg(v)| over edges, degree variance, and the maximum/minimum degree gap. Identifies strongly-regular candidates by checking common neighbour counts for adjacent vs non-adjacent pairs.
-**Complexity:** O(k · (V + E)) per source for BFS layers
308
+
-**Algorithm:** BFS expansion from a source vertex producing the sequence of k-hop layers, the cumulative reachable set, and the growth profile |N_k| / |N_{k−1}|. Aggregates per-vertex 1-hop neighbour-degree statistics (mean, variance) used downstream by entropy and similarity analyzers.
309
+
-**Use cases:** Influence radius estimation, locality-sensitive features for link prediction, ego-network construction.
310
+
311
+
### Graph Labeling
312
+
-**File:**`GraphLabelingAnalyzer.java`
313
+
-**Complexity:** O(V! · E) worst-case backtracking; feasible for V ≤ ≈ 20
314
+
-**Algorithm:** Backtracking search with pruning for graph-labeling problems — primarily *graceful labeling* (vertices labelled 0..m so that edge labels |f(u) − f(v)| are exactly {1..m}). Also computes magic-labeling candidates and reports the first feasible labeling discovered.
315
+
-**Use cases:** Combinatorial design verification, exam-scheduling toy models, teaching examples for NP-hard search.
316
+
317
+
### Metric Dimension
318
+
-**File:**`MetricDimensionAnalyzer.java`
319
+
-**Complexity:** NP-hard exact (subset enumeration with pruning); O(V·(V + E)) per inner BFS
320
+
-**Algorithm:** Finds the minimum *resolving set* — a subset S ⊆ V such that the distance vector (d(v, s))_{s∈S} is unique for every v. Uses incremental subset search with twin-vertex pruning (twins must be separated). Returns the metric dimension β(G), an optimal resolving set, and per-vertex distance signatures.
-**Complexity:** O(k · (V + E)) per Weisfeiler–Leman iteration; exponential worst-case for the exact automorphism group
326
+
-**Algorithm:** Color-refinement (1-WL) produces vertex equivalence classes that are a superset of true orbits; for small graphs these are refined by backtracking automorphism search. Reports orbit sizes, vertex-/edge-transitivity flags, and a symmetry score (fraction of vertices in non-trivial orbits).
327
+
-**Use cases:** Structural equivalence detection, canonical labelling, anomaly detection (vertices in singleton orbits often play unique roles).
328
+
329
+
### Graph Drawing Quality
330
+
-**File:**`GraphDrawingQualityAnalyzer.java`
331
+
-**Complexity:** O(E²) for edge-crossing count; O(V + E) for the remaining metrics
332
+
-**Algorithm:** Evaluates the aesthetic quality of a 2-D layout using standard graph-drawing metrics: edge-crossing count, edge-length uniformity (coefficient of variation), minimum angular resolution at vertices, node-overlap ratio, and stress (Σ (d_euc − d_graph)² weighted by 1/d_graph²). Produces a composite readability score.
-**Complexity:** O(V + E) for modularity, conductance, coverage, performance
338
+
-**Algorithm:** Evaluates any vertex partition (from Louvain, GraphPartitioner, or user-supplied) using a battery of partition-quality metrics: Newman–Girvan modularity Q, conductance per cluster and aggregate, coverage (fraction of intra-cluster edges), performance, and normalised cut. Reports per-cluster density and size distribution.
-**Complexity:** O(V² + E) for full computation (eigenvalue decomposition dominates)
@@ -321,6 +401,12 @@ A comprehensive reference for all graph algorithms implemented in GraphVisual, o
321
401
-**Complexity:** O(V × avg_degree²) per metric
322
402
-**Algorithm:** Predicts missing edges using four similarity metrics: Common Neighbors, Jaccard Coefficient, Adamic-Adar Index, and Preferential Attachment.
323
403
404
+
### Node Similarity (Structural)
405
+
-**File:**`NodeSimilarityAnalyzer.java`
406
+
-**Complexity:** O(V² · avg_degree) for all-pairs; O(V · avg_degree) per query pair
407
+
-**Algorithm:** Pairwise structural similarity using Jaccard, Overlap (Szymkiewicz–Simpson), Adamic–Adar, Sørensen–Dice, cosine over neighbour-set indicator vectors, and preferential-attachment scores. Returns ranked top-k similar pairs and per-vertex nearest-neighbour lists.
408
+
-**Use cases:** Friend recommendation, role discovery, candidate generation for link prediction, structural deduplication.
409
+
324
410
### Influence Spread (Independent Cascade)
325
411
-**File:**`InfluenceSpreadSimulator.java`
326
412
-**Complexity:** O(simulations × (V + E))
@@ -333,6 +419,44 @@ A comprehensive reference for all graph algorithms implemented in GraphVisual, o
333
419
334
420
---
335
421
422
+
## Graph Transformation & Construction
423
+
424
+
### Line Graph L(G)
425
+
-**File:**`LineGraphAnalyzer.java`
426
+
-**Complexity:** O(V + E · avg_degree) construction; O(E²) worst-case for dense graphs
427
+
-**Algorithm:** Builds the line graph L(G), in which every edge of G becomes a vertex of L(G) and two vertices of L(G) are adjacent iff their underlying edges share an endpoint. Provides forward/backward edge-vertex mappings, reports |V(L(G))| = |E(G)| and |E(L(G))| = Σ_v C(deg(v), 2), and exposes line-graph-specific properties (claw-freeness check, triangle count translation, Whitney-isomorphism witnesses where applicable).
428
+
-**Use cases:** Reducing edge-centric problems (edge colouring, edge betweenness) to vertex-centric ones, characterisation of line-graph-recognisable structures, theoretical conversions.
429
+
430
+
### Graph Complement Ḡ
431
+
-**File:**`GraphComplementAnalyzer.java`
432
+
-**Complexity:** O(V²) construction; complement-vs-original comparison in O(V + E)
433
+
-**Algorithm:** Constructs the complement Ḡ, in which an edge exists iff it does *not* exist in G. Provides side-by-side statistics: density, degree sequence, connected-component count, triangle count, and self-complementary detection. Useful as a primitive for clique-cover / coloring duality (θ(G) = χ(Ḡ)) and perfect-graph testing.
434
+
-**Use cases:** Anti-edge analysis, sparse↔dense problem conversion, exposing missing-relationship structure in social graphs.
435
+
436
+
### Graph Minor Operations
437
+
-**File:**`GraphMinorAnalyzer.java`
438
+
-**Complexity:** O(V + E) per edge contraction, vertex deletion, or edge deletion
439
+
-**Algorithm:** Implements the minor-construction primitives: edge contraction (merge endpoints, redirect incident edges, deduplicate, drop self-loops), vertex deletion (with all incident edges), and edge deletion. Supports replay of a recorded minor sequence to derive a minor H ≤ G and verifies subgraph / topological-minor relationships for small witnesses.
440
+
-**Use cases:** Treewidth experimentation, Robertson–Seymour-style minor checks, network simplification while preserving connectivity skeletons.
441
+
442
+
### Graph Sparsification
443
+
-**File:**`GraphSparsificationAnalyzer.java`
444
+
-**Complexity:** O(V·E) for cached edge-betweenness; O(E log E) for random / spanning-tree variants
445
+
-**Algorithm:** Reduces |E| while preserving target structural properties. Strategies: (a) spanning-tree sparsification (minimum edges keeping connectivity), (b) edge-importance scoring via betweenness / bridge detection / redundancy with a cached betweenness pass, and (c) random sparsification toward a target retention ratio. Reports retention statistics, change in connectivity / diameter / clustering, and per-edge importance scores.
446
+
-**Use cases:** Speeding up downstream analyses on dense graphs, visual decluttering for large layouts, building benchmark families.
-**Algorithm:** A tournament is a directed graph obtained by orienting every edge of K_n. Implements the constructive O(n²) Hamiltonian-path algorithm (every tournament has one), score-sequence computation with Landau's necessary-and-sufficient condition, king-vertex detection (vertex reaching all others in ≤ 2 hops), strong-connectivity test, and transitive-tournament recognition.
0 commit comments