I'm not understanding the docs on parallelization. I'd like to parallelize 
a betweenness centrality calculation:

    for s in nodes
        state = dijkstra_shortest_paths(g, s; allpaths=true)
        if endpoints
            _accumulate_endpoints!(betweenness, state, g, s)
        else
            _accumulate_basic!(betweenness, state, g, s)
        end
    end


nodes is a vector of ints over which the calculation should be run (by 
default, this is every vertex in the graph). Because both state() and 
_accumulate_* are independent calculations, it seems to me that I could 
take advantage of multiple cores / processors to speed things up. However, 
I don't know where to start. Any advice would be greatly appreciated.

State has arrays of ints called "dists" and "parents" - each run through 
this loop alters these arrays, but there's no dependence between loop 
iterations.

Reply via email to