On this page 
Overview

In Houdini, edges are normally treated as undirected and shared between faces. However, for some tasks (such as simplifying or cleaning geometry) it is useful to view faces as each having their own edges. 

You can think of this as splitting each shared undirected edge along its length into two half edges. (Boundary edges of course will only have one “halfedge”.) 

Each halfedge is directed (it has a start vertex and an end vertex). 

The halfedge functions let you quickly find a halfedge’s source and destination vertex, the next halfedge, get the other halfedges from the same edge, find all halfedges sharing a given point, and other manipulations. 
Equivalence
Two halfedges are equivalent if they are “split” from the same shared edge. In the following figure, three primitives share an edge. The halfedges e, f, and g are equivalent because they are from the same edge. Directionality does not matter – e is considered equivalent to f and g even though they have opposite directions.
The source (and destination) vertex of a halfedge uniquely identify it, meaning that there can be at most one halfedge with a given vertex as the source. This is because a vertex can belong to only one primitive. However, because several vertices can be wired to the same point, halfedges can have shared source and destination points. Another way of thinking about equivalence is that two halfedges are equivalent if their vertices are shared by the same two points.
One of a set of equivalent halfedges is considered the primary halfedge in that class. The VEX functions let you check if a given halfedge is primary, or given a nonprimary halfedge, find the equivalent primary halfedge. In the case of an unshared edge, it only has a single primary halfedge.
Functions
Check whether a halfedge is valid 

Check whether a halfedge is primary 

Find the primary equivalent halfedge. If it belongs to an unshared edge, then the same halfedge is returned. 

Test whether two halfedges are equivalent 

Iterate over the halfedges in an equivalence class 

Get the number of halfedges in an equivalence class 

Get the source vertex of a halfedge 

Get the destination vertex of a halfedge 

Get the vertex preceding the source vertex in halfedge primitive 

Get the vertex following the destination vertex in halfedge primitive 

Get the primitive of a halfedge 

Get the source point of a halfedge 

Get the destination point of a halfedge 

Get the presource point of a halfedge 

Get the postdestination point of a halfedge 

Get the next halfedge in primitive 

Get the previous halfedge in primitive 

Find halfedge between two points 

Find halfedge with given source and destination 

Find a halfedge with a given source point 

Iterate over halfedges with a given source point 

Get the halfedge with a source vertex 

Get a halfedge on a given primitive 