Role Extraction, Dynamics, And Optimisation On Networks