Algorithms for network analysis