الگوریتم یافتن دور اویلری در یک گراف



کد:
type  

      yalrec=record

       color:1..4;

       state:0..1;

       end;

var

counternode:integer;// count of node in graph  

 yalarray:array[1..100,1..100] of yalrec;   // yal state in graph



Function Oleri : Boolean;

var i,j:integer;

    counter:integer;

begin

 Result := True;

 for i:=1 to counternode do

 begin

 counter:=0;

  for j:=1 to counternode do

    if yalarray[i,j].state=1 then inc(counter);

   if counter mod 2 =1 then

     begin

      Result := False;

      exit;

     end;

 end;

end;