A Matrix Algorithm for Solutions and r-Bases of a Finite Irreflexive Relation