edges([b-g,b-c,b-e,g-f,f-c,e-d]).
vertecies([a,b,c,d,e,f,g,h]).
s([h,a,f,g,w,n,s,a,j,d,m,d,e,h]).
%********************Works
%extracting vertecies witout dublicats
extract_vert([],[]).
vertex(G,L):-
extract_vert(G,L1),
remove1(L1,L).
extract_vert([X-Y|T],[X,Y|T1]):-
extract_vert(T,T1).
%removing dublicats
remove1([], []).
remove1([A|L], Res):-
member(A, L),
!,
remove1(L, Res).
remove1([A|L], [A|Res]):-
remove1(L, Res).
%getting isolated vertecies
diff([],_,[]).
diff([X|M1],M2,[X|M]):-
not(member(X,M2)),
!,
diff(M1,M2,M).
diff([_|M1],M2,M):-
diff(M1,M2,M).
%/*********
get_solution(G,R):-
vertex(G,L),vertecies(V),diff(V,L,R).
|