Distance-Hereditary Graph Checker

distance preservation

CheckersFreeNo Signup
4.8(285 reviews)
All Tools

Loading tool...

About Distance-Hereditary Graph Checker

A distance-hereditary graph checker testing if d_H(u,v) = d_G(u,v) for every connected induced subgraph H. Equivalent: no induced cycle ≥ 5 has no chord or exactly one chord. Cograph ⊂ distance-hereditary. O(n+m) recognition. Client-side.

Distance-Hereditary Graph Checker Features

  • DH test
  • Distance preserve
  • Pruning seq
  • O(n+m)
  • Cograph gen
Distance-hereditary graph: for every connected induced subgraph H, distances in H equal distances in G. Equivalently built by: pendant vertex additions, twin vertex additions. Generalize cographs. O(n+m) recognition via pruning sequence.

How to Use

Select graph:

  • Test: DH?
  • Distances: Preservation
  • Pruning: Build sequence

Characterization

Equivalent: (1) no induced C_k (k≥5) with 0 or 1 chord, (2) built by pendant/twin additions, (3) every cycle of length ≥5 has ≥2 crossing chords. Bandelt-Mulder (1986): hanging decomposition.

Algorithms

Many NP-hard problems polynomial: Steiner tree, domination, bandwidth, Hamiltonian path. Use pruning sequence (vertex elimination order) for dynamic programming. Very powerful algorithmic framework.

Step-by-Step Instructions

  1. 1Select graph.
  2. 2Check DH.
  3. 3Find pruning seq.
  4. 4Verify distances.
  5. 5Apply DP.

Distance-Hereditary Graph Checker — Frequently Asked Questions

How do DH graphs relate to cographs?+

Every cograph is distance-hereditary (cographs have diameter ≤ 2 in each component). DH graphs allow longer distances but preserve them. DH strictly contains cographs. Both have tree-like decompositions.

What's a pruning sequence?+

Sequence of pendant (degree-1) and twin (same neighborhood) vertex removals that reduces graph to single vertex. Exists iff graph is DH. Generalizes cotree. O(n+m) to compute.

What's a ptolemaic graph?+

DH ∩ chordal = ptolemaic. Satisfies Ptolemy's inequality: d(a,c)·d(b,d) ≤ d(a,b)·d(c,d) + d(a,d)·d(b,c). Includes block graphs. Beautiful metric characterization.

Share this tool: