Adjacency matrix. Bfs and dfs for matrix.