Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
trac #16403: Remove Graph.to_partition
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanncohen committed May 27, 2014
1 parent a3c4cf3 commit 9f08c6b
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/sage/graphs/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@
import sage.graphs.generic_graph_pyx as generic_graph_pyx
from sage.graphs.generic_graph import GenericGraph
from sage.graphs.digraph import DiGraph
from sage.combinat.combinatorial_map import combinatorial_map

class Graph(GenericGraph):
r"""
Expand Down Expand Up @@ -1759,22 +1758,6 @@ def sparse6_string(self):

### Attributes

@combinatorial_map(name="partition of connected components")
def to_partition(self):
"""
Return the partition of connected components of ``self``.
EXAMPLES::
sage: for x in graphs(3): print x.to_partition()
[1, 1, 1]
[2, 1]
[3]
[3]
"""
from sage.combinat.partition import Partition
return Partition(sorted([len(y) for y in self.connected_components()], reverse=True))

def is_directed(self):
"""
Since graph is undirected, returns False.
Expand Down

0 comments on commit 9f08c6b

Please sign in to comment.