Algorithm to Obtain Total Order from Partial Orders for Social Networks