Created
November 25, 2017 14:32
-
-
Save import-benjamin/f8ca344dec44177825eb30bed37cbadd to your computer and use it in GitHub Desktop.
graph theory : check if two node are connected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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