Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Return True if G is bipartite, False otherwise.

        def isBipartite(G):
    """
    Return True if G is bipartite, False otherwise.
    """
    try:
        TwoColor(G)
        return True
    except NonBipartite:
        return False
        


src/p/y/pystream-HEAD/lib/PADS/PartialCube.py   pystream(Download)
import BFS
import Medium
from Bipartite import isBipartite
from UnionFind import UnionFind
from StrongConnectivity import StronglyConnectedComponents
    # Main contraction loop in place of the original algorithm's recursion
    while len(CG) > 1:
        if not isBipartite(CG):
            raise Medium.MediumError("graph is not bipartite")
 

src/p/a/PADS-0.0.20131119/pads/PartialCube.py   PADS(Download)
import BFS
import Medium
from Bipartite import isBipartite
from UnionFind import UnionFind
from StrongConnectivity import StronglyConnectedComponents
    # Main contraction loop in place of the original algorithm's recursion
    while len(CG) > 1:    
        if not isBipartite(CG):
            raise Medium.MediumError("graph is not bipartite")