Algorithm 1.
HW(G, k): Compute if hw(G) ≤ k
| if G has no edges then |
| return true |
| end if |
| if k = 0 then |
| return false |
| end if |
| for e ∈ edges(G) do |
| Let Ḡ be the graph that results from removing e from the connected component of G that contains e |
| if HW(Ḡ, k − 1) then |
| return true |
| end if |
| end for |
| return false |