UltipaDocs
Products
Solutions
Resources
Company
Start Free Trial
UltipaDocs
Start Free Trial
  • Introduction
  • Running Algorithms
    • Degree Centrality
    • Closeness Centrality
    • Harmonic Centrality
    • Eccentricity Centrality
    • Betweenness Centrality
    • Bridges
    • Articulation Points
    • Eigenvector Centrality
    • Katz Centrality
    • CELF
    • PageRank
    • ArticleRank
    • TextRank
    • HITS
    • SybilRank
    • Jaccard Similarity
    • Overlap Similarity
    • Cosine Similarity
    • Pearson Correlation Coefficient
    • Euclidean Distance
    • KNN
    • Vector Similarity
    • Bipartite Graph
    • HyperANF
    • Weakly Connected Components (WCC)
    • Strongly Connected Components (SCC)
    • k-Edge Connected Components
    • Local Clustering Coefficient
    • Triangle Count
    • Clique Count
    • k-Core
    • k-Truss
    • p-Cohesion
    • Induced Subgraph
    • Topological Sort
    • Breadth-First Search (BFS)
    • Depth-First Search (DFS)
    • Dijkstra's Shortest Path
    • A* Shortest Path
    • Yen's K-Shortest Paths
    • Shortest Path (BFS)
    • Delta-Stepping SSSP
    • Shortest Path Faster Algorithm (SPFA)
    • All-Pairs Shortest Path (APSP)
    • Minimum Spanning Tree (MST)
    • K-Spanning Tree
    • Steiner Tree
    • Prize-Collecting Steiner Tree (PCST)
    • Minimum Cost Flow
    • Maximum Flow
    • K-Hop Fast
    • Longest Path (DAG)
    • Random Walk
    • Adamic-Adar Index
    • Common Neighbors
    • Preferential Attachment
    • Resource Allocation
    • Total Neighbors
    • Same Community
    • Louvain
    • Leiden
    • Modularity Optimization
    • Label Propagation
    • HANP
    • SLPA
    • k-Means
    • HDBSCAN
    • K-1 Coloring
    • Modularity
    • Conductance
    • Max k-Cut
      • Node2Vec
      • Struc2Vec
      • LINE
      • Fast Random Projection
      • Summary of Graph Embedding
      • Gradient Descent
      • Backpropagation
      • Skip-gram
      • Skip-gram Optimization
  1. Docs
  2. /
  3. Graph Algorithms
  4. /
  5. Centrality

Bridges

Overview

The Bridges algorithm finds bridge edges in a graph — edges whose removal would disconnect the graph (or increase the number of connected components). Bridge edges represent critical connections and potential vulnerabilities in a network.

Concepts

Bridge Edge

A bridge (also called a cut edge) is an edge in an undirected graph whose removal increases the number of connected components. In other words, removing a bridge edge splits a connected part of the graph into two separate parts.

In this graph, the edge B - C is a bridge because removing it disconnects C from A and B. However, if there's also an edge A - C, then B - C is no longer a bridge since C can still reach A through the alternative path.

Bridge detection is important for:

  • Network reliability: Identifying single points of failure in infrastructure networks.
  • Graph structure analysis: Understanding the articulation structure of a graph.
  • Preprocessing: Decomposing a graph into 2-edge-connected components.

Considerations

  • The algorithm treats all edges as undirected.
  • Isolated nodes produce no bridge edges.

Example Graph

GQL
INSERT (A:default {_id: "A"}), (B:default {_id: "B"}),
       (C:default {_id: "C"}), (D:default {_id: "D"}),
       (E:default {_id: "E"}), (F:default {_id: "F"}),
       (A)-[:default]->(B), (B)-[:default]->(C),
       (C)-[:default]->(A), (C)-[:default]->(D),
       (D)-[:default]->(E), (E)-[:default]->(F),
       (F)-[:default]->(D)

Run Mode

Returns:

ColumnTypeDescription
sourceIdSTRINGSource node identifier (_id)
targetIdSTRINGTarget node identifier (_id)
isBridgeBOOLWhether the edge is a bridge

Find all bridge edges:

GQL
CALL algo.bridges() YIELD sourceId, targetId, isBridge

Result:

sourceIdtargetIdisBridge
DCtrue

Stream Mode

Returns the same columns as run mode, streamed for memory efficiency.

GQL
CALL algo.bridges.stream() YIELD sourceId, targetId
RETURN sourceId, targetId

Result:

sourceIdtargetId
DC

Stats Mode

Returns:

ColumnTypeDescription
nodeCountINTTotal number of nodes
bridgeCountINTNumber of bridge edges
GQL
CALL algo.bridges.stats() YIELD nodeCount, bridgeCount

Result:

nodeCountbridgeCount
61