Skip to main content
`Ctrl`+`K`

# not_implemented_for

not_implemented_for(*graph_types)

  Decorator to mark algorithms as not implemented

  Parameters:
    graph_types container of strings

      Entries must be one of “directed”, “undirected”, “multigraph”, or “graph”.

  Returns:
    _require function

      The decorated function.

  Raises:
    NetworkXNotImplemented
    If any of the packages cannot be imported

  Notes

  Multiple types are joined logically with “and”. For “or” use multiple @not_implemented_for() lines.

  Examples

  Decorate functions like this:

      @not_implemented_for("directed")
      def sp_function(G):
          pass

      # rule out MultiDiGraph
      @not_implemented_for("directed", "multigraph")
      def sp_np_function(G):
          pass

      # rule out all except DiGraph
      @not_implemented_for("undirected")
      @not_implemented_for("multigraph")
      def sp_np_function(G):
          pass