Skip to content

Instantly share code, notes, and snippets.

@import-benjamin
Created November 25, 2017 14:32
Show Gist options
  • Save import-benjamin/f8ca344dec44177825eb30bed37cbadd to your computer and use it in GitHub Desktop.
Save import-benjamin/f8ca344dec44177825eb30bed37cbadd to your computer and use it in GitHub Desktop.
graph theory : check if two node are connected
// desc : vérife si un ou des sommets sont adjacents.
// input : Liste d'adjacence ([S, T]), sommet (x), voisin (y)
// output : boolean (bool)
function bool = present(S, T, x, y)
tblMatch = length(find(liste_succ(S, T, x)==y))
if( tblMatch > 0) then bool = 1; else bool = 0; end
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment