Algorithm for finding graph levels I have found an algorithm to separate a graph in its different levels, but as I don't know its name, and I couldn't find it anywhere else I don't trust it 100%. It goes like this:
Given de adjacency matrix of G = (V,E), M:

i = 1
while M ≠ 0:
    Level i = vertices such that their rows and columns in M are all 0.
    M = M - rows and columns which are all 0.
    i = i + 1

(M != 0 means M is not empty)
Does this always work? Does it have a name or can I find it anywhere else?
EDIT:
This is the definition of "level" that I have for a directed graph: A set of vertices N is in a higher level than other set of vertices K if no vertex in N is reachable from any vertex in K.
Here's the example from where I found this pseudocode. There's the original graph (middle), the vertices on each level (left), and another graph which I'm not quite sure why it's there, but its clear that its exactly the same as the original just rearranged to make clear the "partition" into different "levels"

I posted this mainly because this definition of level, the algorithm and the example are on a note written by some other student I don't know, and she didn't put any bibliographic references or anything, and I'm studying for an exam on my own because I didn't go to the classes... and these topics are not so easy to Google due to different namings, etc.
This somehow reminds me of topological order too...maybe it has something to do with that?
 A: What you define there isn't even a partial ordering, The set {A} is higher than {G} (G can't reach A), and {G} is higher than {A} (A can't reach G), so your levels aren't actually correct A>G, G>A. It is a pre-ordering but there's not as much one can assume about pre-orders.
Also that algorithm doesn't halt on
$1-> 2-> 3$
which has the adjacency matrix
$010\\001\\000$
By your algorithm, level 1 = {}, next matrix is,
$10\\01$
And then this loops forever.
So no this algorithm as you describe does not give the results you desire.
Edit:
Assuming this is a Directed Acyclic Graph (DAG), the algorithm is as follows,
level 1 = all Nodes with no edges in
level n+1 = (all nodes reachable by level n) -(disjoint) (all nodes reachable by any other node in level n)
A: From Introduction to algorithms, Thomas Cormen: "... Another way to perform topological sorting on a directed acyclic graph is to repeatedly find a vertex of in-degree 0, output it, and remove it and
all of its outgoing edges from the graph.' 
Which is precisely what the pseudocode I wrote does. So I will just forget about the word "level" and perform a topological sorting, which is the same.
