PDA

View Full Version : یافتن دور اویلری



sepedeh
سه شنبه 17 خرداد 1384, 10:02 صبح
الگوریتم یافتن دور اویلری در یک گراف را کسی دارد (فرصت زیادی ندارم)
باتشکر فراوان

مصطفی ساتکی
یک شنبه 13 خرداد 1386, 06:26 صبح
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;