Ticket #14173: trac_14173.patch

File trac_14173.patch, 2.6 KB (added by ncohen, 8 years ago)
  • sage/graphs/graph.py

    # HG changeset patch
    # User Nathann Cohen <nathann.cohen@gmail.com>
    # Date 1361729470 -3600
    # Node ID 4275ccc067ec713233e3b8ba8e3ae93e9da05da6
    # Parent  36125c7114724a6bf93066dd58b2f54560be29af
    Stopgap warning in Graph.modular_decomposition
    
    diff --git a/sage/graphs/graph.py b/sage/graphs/graph.py
    a b  
    53995399        Returns the modular decomposition of the current graph.
    54005400
    54015401        Crash course on modular decomposition:
    5402        
     5402
    54035403        A module `M` of a graph `G` is a proper subset of its vertices
    54045404        such that for all `u \in V(G)-M, v,w\in M` the relation `u
    54055405        \sim v \Leftrightarrow u \sim w` holds, where `\sim` denotes
     
    54435443        You may also be interested in the survey from Michel Habib and
    54445444        Christophe Paul entitled "A survey on Algorithmic aspects of
    54455445        modular decomposition" [HabPau10]_.
    5446    
     5446
    54475447        OUTPUT:
    5448    
     5448
    54495449        A pair of two values (recursively encoding the decomposition) :
    5450        
     5450
    54515451            * The type of the current module :
    5452    
     5452
    54535453                * ``"Parallel"``
    54545454                * ``"Prime"``
    54555455                * ``"Serie"``
    5456    
     5456
    54575457            * The list of submodules (as list of pairs ``(type, list)``,
    54585458              recursively...) or the vertex's name if the module is a
    54595459              singleton.
    5460    
     5460
    54615461        EXAMPLES:
    5462    
     5462
    54635463        The Bull Graph is prime::
    5464    
     5464
    54655465            sage: graphs.BullGraph().modular_decomposition()
    54665466            ('Prime', [3, 4, 0, 1, 2])
    5467    
     5467
    54685468        The Petersen Graph too::
    5469    
     5469
    54705470            sage: graphs.PetersenGraph().modular_decomposition()
    54715471            ('Prime', [2, 6, 3, 9, 7, 8, 0, 1, 5, 4])
    5472    
     5472
    54735473        This a clique on 5 vertices with 2 pendant edges, though, has a more
    54745474        interesting decomposition ::
    5475    
     5475
    54765476            sage: g = graphs.CompleteGraph(5)
    54775477            sage: g.add_edge(0,5)
    54785478            sage: g.add_edge(0,6)
     
    54815481
    54825482        ALGORITHM:
    54835483
    5484         This function uses a C implementation of a 2-step algorithm 
     5484        This function uses a C implementation of a 2-step algorithm
    54855485        implemented by Fabien de Montgolfier [FMDec]_ :
    54865486
    54875487            * Computation of a factorizing permutation [HabibViennot1999]_.
     
    55125512          vol 4, number 1, pages 41--59, 2010
    55135513          http://www.lirmm.fr/~paul/md-survey.pdf
    55145514        """
     5515        from sage.misc.stopgap import stopgap
     5516        stopgap("Graph.modular_decomposition is known to return wrong results",13744)
    55155517
    55165518        from sage.graphs.modular_decomposition.modular_decomposition import modular_decomposition
    55175519