I am trying to remove vertices that have degree less than 2, but I think I am missing something basic.
I was hoping that I could use:
VertexDelete[g, VertexDegree[#] < 2 & ]
But it seems that this is not supported in a few ways.
- I know that I can operate on one vertex at a time from the examples, but that seems to use pattern matching, rather than a pure function. I tried using
_?(VertexDegree[#] < 2 &)
instead as the pure function, but there still is a bigger issue - The
VertexDegree
does not have an overload that just takes a "vertex" object. For that matter, I don't even know what is being matched in theVertexDelete
function. Is it the label of the node only?
I sense I am missing something basic about this whole process. Any pointers?