Given a graph, removing pendant vertices (vertices with only one neighbor) and vertices that have a twin (another vertex that
has the same neighbors) until it is not possible yields a reduced graph, called the “pruned graph”. In this paper, we present
an algorithm which computes this “pruned graph” either in linear time or in linear space. In order to achieve these complexity
bounds, we introduce a data structure based on digital search trees. Originally designed to store a family of sets and to
test efficiently equalities of sets after the removal of some elements, this data structure finds interesting applications
in graph algorithmics. For instance, the computation of the “pruned graph” provides a new and simply implementable algorithm
for the recognition of distance-hereditary graphs, and we improve the complexity bounds for the complete bipartite cover problem
on bipartite distance-hereditary graphs.
Keywords graph algorithms - distance-hereditary graphs - sets - digital search trees - amortized complexity