Q:

what does the concept of using dot product and < do in the following code?

bool operator() (const Vertex& a, const Vertex& b) const
    {
        return dot(a,dir)<dot(b,dir); 
    }

The dot() returns the dot product of a,dir.what is the use of < symbol in  above program code? 

A:

If both vectors are normalized (i.e. their lengths equal 1) the dot product returns the cosine of the angle between them (range is -1..+1). So the operator effectively returns whether the vector of the first vertex has a larger angle to the direction vector than the vector of the second vertex.

