Network as a computer: ranking paths to find flows