Design an algorithm to check whether the given graph is connected using the adjacency matrix representation.