If I have a very large graph (set of edges and vertices, NOT the "picture/sketch" of the graph), what is a very efficient way to find all the vertices with only one edge attached to them. Most of the vertices will have many edges attached to them. Also any vertex may be connected to itself, and when we say that we want all vertices with only one edge we really mean all vertices with at most one non-self edge (i.e. may be connected to self and at most one other vertex).(adsbygoogle = window.adsbygoogle || []).push({});

I'm looking for some sort of computer algorithm to sort out a very large E=edge and V=vertex pair of sets.

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Graph theory algorithm

**Physics Forums | Science Articles, Homework Help, Discussion**