I have a planar graph and I'm trying to implement this algorithm (https://geometrictools.com/Documentation/MinimalCycleBasis.pdf Chapter 4, page 3). For the filament F0(V4, V3, V2), that has one endpoint (same for filament F2), it's easy to detect and remove in a graph (I think it's sufficient iterate vertices and when I find a vertex x that has just one neighboor (length[Adjustment_list[x] == 1), I remove the entire path (except the source node). But how can I remove the filament F1(V5, V6, V8), that has terminating branch points?
P.S. I'm currently working in Java, feel free to poste code if present.
Thanks in advance!