added some pseudo code for edge weight computation