Graph Pathwidth Calculator

path decomposition width

CalculatorsFreeNo Signup
4.5(442 reviews)
All Tools

Loading tool...

About Graph Pathwidth Calculator

A graph pathwidth calculator computing pw(G): minimum width of a path decomposition. pw(P_n)=1, pw(C_n)=2, pw(K_n)=n-1, pw(tree)=node search number-1. FPT in pw. Interval graph supergraph characterization. Client-side.

Graph Pathwidth Calculator Features

  • pw(G) value
  • Path decomposition
  • Search number
  • FPT
  • Common graphs
Pathwidth pw(G): minimum width of path decomposition (tree decomposition that is a path). pw(P_n)=1, pw(C_n)=2, pw(K_n)=n-1. Equals node search number - 1 (Kirousis-Papadimitriou). pw ≤ tw ≤ pw always. FPT algorithms exist.

How to Use

Select graph:

  • pw: Pathwidth
  • Bags: Decomposition
  • Search: Node search #

Node Search Number

pw(G) + 1 = node search number: minimum searchers to clear a contaminated graph. Place/remove searchers on vertices to 'clean' edges. Beautiful game-theoretic characterization of pathwidth.

pw vs tw

pw(G) ≥ tw(G) always. Can be much larger: pw(n×n grid) = n but tw(n×n grid) = n. For trees: pw = tw. Pathwidth measures 'path-likeness', treewidth measures 'tree-likeness'.

Step-by-Step Instructions

  1. 1Select graph.
  2. 2Compute pathwidth.
  3. 3Find decomposition.
  4. 4Compare to tw.
  5. 5Apply search game.

Graph Pathwidth Calculator — Frequently Asked Questions

When is pw = tw?+

For trees, outerplanar graphs, and many sparse graph families. For grids: tw(n×n)=n but pw(n×n)=n also. The gap between pw and tw can be logarithmic: pw(T) ≤ O(tw·log n) for any graph.

What's a path decomposition?+

A tree decomposition where the tree is a path. Sequence of bags B_1,...,B_k where: (1) every vertex appears in some bag, (2) every edge has both endpoints in some bag, (3) bags containing each vertex are consecutive. Width = max bag size - 1.

Can pathwidth be computed efficiently?+

NP-hard in general. But FPT: O(2^{pw}·n) algorithm exists. For trees: polynomial time. For interval graphs: pw = ω-1. For specific graph classes: specialized algorithms available.

Share this tool: