Cody

Solution 1681996

Submitted on 28 Nov 2018 by Binbin Qi
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
A = [ 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 0 1 0 1 0 0]; nCycles = 6; assert(isequal(count_undirected_cycles(A),nCycles))

Elapsed time is 0.008540 seconds. cycles in graph size count 3 3 4 2 5 1

2   Pass
A = [ 0 0 1 1 1 0 1 0 0 0 0 1 1 1 1 1 1 0 0 0 1 0 1 0 1 1 0 0 1 0 0 1 1 1 1 1 0 0 0 1 0 1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 0 1 0 1 1 1 1 0]; nCycles = 136; assert(isequal(count_undirected_cycles(A),nCycles))

Elapsed time is 0.003073 seconds. cycles in graph size count 3 9 4 18 5 27 6 40 7 32 8 10

3   Pass
A = [ 0 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0 0 1 0 0 1 0 1 0 1 1 0 0 1 0 1 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 1 1 0 1 1 0 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 1 0 0 1 1 0 0 0 1 1 0 1 0 1 0 0 0 1 0]; nCycles = 251; assert(isequal(count_undirected_cycles(A),nCycles))

Elapsed time is 0.002257 seconds. cycles in graph size count 3 6 4 14 5 28 6 38 7 54 8 57 9 36 10 18

4   Pass
A = [ 0 0 0 0 0 1 1 0 0 1 0 0 1 1 0 0 1 1 0 0 0 1 0 0 0 1 1 1 0 1 0 1 0 0 1 0 1 0 1 1 0 0 0 1 0 0 0 0 1 1 1 0 1 0 0 0 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 1 1 0 0 1 0 0 1 1 0 0 0 1 1 1 0 1 0 1 1 0 1 1 1 1 0 1 1 0]; nCycles = 1579; assert(isequal(count_undirected_cycles(A),nCycles)) A = [ 0 0 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0 1 0 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 0 1 1 0 0 1 0 1 1 0 0 0 0 1 0 1 0 1 1 1 1 0]; nCycles = 147; assert(isequal(count_undirected_cycles(A),nCycles))

Elapsed time is 0.016491 seconds. cycles in graph size count 3 17 4 37 5 93 6 204 7 348 8 428 9 334 10 118 Elapsed time is 0.001706 seconds. cycles in graph size count 3 10 4 15 5 24 6 35 7 40 8 23