-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathis_kuratowski_graph.m
33 lines (26 loc) · 1.05 KB
/
is_kuratowski_graph.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function is_kgraph = is_kuratowski_graph(A,varargin)
% IS_KURATOWSKI_GRAPH Test if a graph can be collapsed to K_3,3 or K_5
%
% is_k = is_kuratowski_graph(A) checks if A can be reduced to K_3,3 or K_5
% by repeated edge contractions. If so, then is_k=1, otherwise is_k=0.
%
% ... = is_straight_line_drawing(A,...) takes a set of
% key-value pairs or an options structure. See set_matlab_bgl_options
% for the standard options.
% No additional options for this function
%
% Example:
% is_kuratowski_graph(clique_graph(4)) % false, K_4 is not kuratowski
% is_kuratowski_graph(clique_graph(5)) % true, K_5 is kuratowski
% is_kuratowski_graph(clique_graph([3,3])) % true, K_3,3 is kuratowski
% David Gleich
% Copyright, Stanford University, 2008
%% History
% 2008-10-05: Initial version
%%
[trans check full2sparse] = get_matlab_bgl_options(varargin{:});
if full2sparse && ~issparse(A), A = sparse(A); end
options = struct();
options = merge_options(options,varargin{:});
if check, check_matlab_bgl(A,struct('sym',1)); end
is_kgraph = planar_test_mex(A,1);