vulnerability function

Calculate graph vulnerability