Cody

# Problem 45219. Find edges from a vertex

Solution 2044022

Submitted on 3 Dec 2019 by William
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
T = [1 2 3 ; 1 3 4 ; 1 4 2 ; 2 3 4]; i = 4; edg_list1 = [1 4; 2 4; 3 4]; edg_list2 = [1 4; 3 4; 2 4]; edg_list3 = [2 4; 1 4; 3 4]; edg_list4 = [2 4; 3 4; 1 4]; edg_list5 = [3 4; 1 4; 2 4]; edg_list6 = [3 4; 2 4; 1 4]; assert(isequal(find_edges_from_vertex(T,i),edg_list1) || isequal(find_edges_from_vertex(T,i),edg_list2) ||... isequal(find_edges_from_vertex(T,i),edg_list3) || isequal(find_edges_from_vertex(T,i),edg_list4) ||... isequal(find_edges_from_vertex(T,i),edg_list5) || isequal(find_edges_from_vertex(T,i),edg_list6))

2   Pass
T = [1 2 4; 2 3 4; 5 6 8; 6 7 8; 1 2 5; 2 5 6; 2 3 6; 3 6 7; 3 4 7; 4 7 8; 4 1 8; 1 8 5]; i = 7; edg_list1 = [3 7; 4 7; 6 7; 7 8]; edg_list2 = [3 7; 4 7; 7 8; 6 7]; edg_list3 = [3 7; 6 7; 4 7; 7 8]; edg_list4 = [3 7; 6 7; 7 8; 4 7]; edg_list5 = [3 7; 7 8; 4 7; 6 7]; edg_list6 = [3 7; 7 8; 6 7; 4 7]; edg_list7 = [4 7; 3 7; 6 7; 7 8]; edg_list8 = [4 7; 3 7; 7 8; 6 7]; edg_list9 = [4 7; 6 7; 3 7; 7 8]; edg_list10 = [4 7; 6 7; 7 8; 3 7]; edg_list11 = [4 7; 7 8; 3 7; 6 7]; edg_list12 = [4 7; 7 8; 6 7; 3 7]; edg_list13 = [6 7; 4 7; 3 7; 7 8]; edg_list14 = [6 7; 4 7; 7 8; 3 7]; edg_list15 = [6 7; 3 7; 4 7; 7 8]; edg_list16 = [6 7; 3 7; 7 8; 4 7]; edg_list17 = [6 7; 7 8; 4 7; 3 7]; edg_list18 = [6 7; 7 8; 3 7; 4 7]; edg_list19 = [7 8; 4 7; 3 7; 6 7]; edg_list20 = [7 8; 4 7; 6 7; 3 7]; edg_list21 = [7 8; 3 7; 4 7; 6 7]; edg_list22 = [7 8; 3 7; 6 7; 4 7]; edg_list23 = [7 8; 6 7; 4 7; 3 7]; edg_list24 = [7 8; 6 7; 3 7; 4 7]; assert(isequal(find_edges_from_vertex(T,i),edg_list1) || isequal(find_edges_from_vertex(T,i),edg_list2) ||... isequal(find_edges_from_vertex(T,i),edg_list3) || isequal(find_edges_from_vertex(T,i),edg_list4) ||... isequal(find_edges_from_vertex(T,i),edg_list5) || isequal(find_edges_from_vertex(T,i),edg_list6) ||... isequal(find_edges_from_vertex(T,i),edg_list7) || isequal(find_edges_from_vertex(T,i),edg_list8) ||... isequal(find_edges_from_vertex(T,i),edg_list9) || isequal(find_edges_from_vertex(T,i),edg_list10) ||... isequal(find_edges_from_vertex(T,i),edg_list11) || isequal(find_edges_from_vertex(T,i),edg_list12) ||... isequal(find_edges_from_vertex(T,i),edg_list13) || isequal(find_edges_from_vertex(T,i),edg_list14) ||... isequal(find_edges_from_vertex(T,i),edg_list15) || isequal(find_edges_from_vertex(T,i),edg_list16) ||... isequal(find_edges_from_vertex(T,i),edg_list17) || isequal(find_edges_from_vertex(T,i),edg_list18) ||... isequal(find_edges_from_vertex(T,i),edg_list19) || isequal(find_edges_from_vertex(T,i),edg_list20) ||... isequal(find_edges_from_vertex(T,i),edg_list21) || isequal(find_edges_from_vertex(T,i),edg_list22) ||... isequal(find_edges_from_vertex(T,i),edg_list23) || isequal(find_edges_from_vertex(T,i),edg_list24))

3   Pass
T = [2 3 5; 3 5 7; 5 7 11; 7 11 13]; i = 8; assert(isempty(find_edges_from_vertex(T,i)))