The PageRank algorithm as a method to optimize swarm behavior through local analysis