Close
Close window
IsBipartite - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

GraphTheory

IsBipartite

test if graph is bipartite

Calling Sequence

IsBipartite(G)

IsBipartite(G, P)

Parameters

G

-

graph

P

-

(optional) name

Description

IsBipartite returns true if the graph G is bipartite and false otherwise. If a variable name P is specified, then this name is assigned a bipartition of the vertices as a list of lists.

A graph G is bipartite if its set of vertices can be partitioned into two sets, V1 and V2, such that every edge in G connects a vertex in V1 or V2 to a vertex in the other set.

Examples

>

withGraphTheory:

>

K32CompleteGraph3,2

K32Graph 1: an undirected graph with 5 vertices and 6 edges

(1)
>

IsBipartiteK32,bp

true

(2)
>

bp

1,2,3,4,5

(3)
>

DrawGraphK32,style=bipartite

>

AdjacencyMatrixK32

0001100011000111110011100

(4)
>

GCycleGraph5

GGraph 2: an undirected graph with 5 vertices and 5 edges

(5)
>

IsBipartiteG

false

(6)


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /