matrix module
adjacency method