Linear ordering of a directed graph's vertices