MATLAB: How to apply netting in Adjacency matrix

adjacency matrix manipulation

I have a weighted Adjacency matrix 138 x 138 representing interbank exposure. A link ij in the matrix represents loans originating from bank i to bank j. I would like to have a netted bilateral exposure such that if two banks lend to one another, for instance, a bank A(i) lends to bank B(j) and B(i) has also lent to A(j). I intend to compare the two loans and subtract the loans and assign the difference to a bank that had the highest value while deleting the link for a bank with the lowest values(assign zero) in the matrix. Any help on how to represent this in a Matlab code will be appreciated.

Best Answer

This sounds like it might be a homework assignment, so I'm only going to give a hint. The transpose operator .' may be of interest to you.
Once you have your modified adjacency matrix, if you want to perform further analysis on it you may want to use it to create a digraph as that will let you easily visualize the network (calling plot on the digraph) and determine node successors, shortest paths, etc.