docs: def validate(self, graph=None):
          """ Returns (Boolean, message) of whether DAG is valid. """
          graph = graph if graph is not None else self.graph
          if len(self.ind_nodes(graph)) == 0:
              return (False, 'no independent nodes detected')
          try:
              self.topological_sort(graph)
          except ValueError:
              return (False, 'failed topological sort')
          return (True, 'valid')