centrality function

Calculate node and edge centrality