def isSafe(i, j, visited, graph):
    """
    This function to check whether a given cell  (row, col) can be included in DFS or not
    :param i: current row number
    :param j: current column number
    :param visited: 2-d grid of visited nodes
    :param graph: given 2-d grid
    :return: bool
    """
    return (
            not visited[i][j]
            and graph[i][j]
    )