# Graph IN-OUT

Graph IN-OUT

IN-OUT Graph (G IN-OUT) is an algorithm suitable to filter a squared matrix of weights, with null main diagonal, generated by any other algorithm.

G IN-OUT algorithm represents the assigned weights matrix as a weighted graph with specific features:

1. The resulting graph is a direct graph when the original matrix is not symmetric;
2. The resulting graph could be composed of sub graphs not necessary connected each other’s (sparse graph)

The logic of G IN-OUT algorithm is simple; if we consider a square asymmetric matrix of connection, where the columns represent the nodes receiving the weighted connections, and the rows represent the same nodes sending their weighted connections,   then:

1. Each node of the rows is linked only to one other node of the columns of its row, where the weight is the strongest; consequently, the each row node will receive an arc from only one column node; that is, for each row node there is only one input (OOI);
2. Each node of the columns is linked to only one node of the rows of its column, where the weights is the strongest; consequently, each column node will send an arc to only one row node; that is, for each column node there is only one output (OOU);

The OOI arc means which node of each column is the closest to which node of each rows, while the OOU arc means to which node of the rows, each node of each columns is the closest.