Algoritmos Heurísticos de Cobertura de Arcos
Algoritmos Heurísticos de Cobertura de Arcos
Algoritmos Heurísticos de Cobertura de Arcos
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
End;<br />
End;<br />
For I:= 1 To M1 Do<br />
Begin<br />
If Link[I].Tipo=0 Then<br />
Begin<br />
J:=Link[I].Arc.Noi;<br />
K:=Link[I].Arc.Nof;<br />
L[J,K]:=MenosInf;<br />
L[K,J]:=MenosInf;<br />
b:=Link[I].ArcContra;<br />
Link[b].arc.Noi:=K;<br />
Link[b].arc.Nof:=J;<br />
End;<br />
End;<br />
End;<br />
Procedure GravaArq(SaveDialog1: TSaveDialog;<br />
OpenDialog1:TOpenDialog;<br />
ListBox1:TlistBox);<br />
Var Frase,TipoArq:String;<br />
ValorFixo:Integer;<br />
II,JJ,M1Orig: Integer;<br />
a,Tip,Noi,I,J,Nof,I1,J1,d,Requerido: Integer;<br />
Linha:String[100];<br />
Begin<br />
ValorFixo:=StrToInt(Form1.Edit9.Text);<br />
ArqNome:=OpenDialog1.FileName;<br />
TipoArq:='N';<br />
If Form1.CheckBox1.Checked Then TipoArq:='U';<br />
If Form1.CheckBox3.Checked Then<br />
If TipoArq='N'<br />
Then TipoArq:='C'<br />
Else TipoArq:='X';<br />
Insert(TipoArq,ArqNome,Length(ArqNome)-3);<br />
saveDialog1.FileName := ArqNome;<br />
If saveDialog1.Execute<br />
Then ArqNome := saveDialog1.FileName<br />
Else Exit;<br />
If Copy(ArqNome,Length(ArqNome)-3,1)='.'<br />
Then ArqNomeTxt := ArqNome<br />
Else ArqNomeTxt := ArqNome+'.Txt';<br />
AssignFile(Re<strong>de</strong>,ArqNomeTxt);<br />
ReWrite(Re<strong>de</strong>);<br />
WriteLn(Re<strong>de</strong>,M1,' ',M2,' ',NL,' ',NC,' ',MA,' ',ME,' ',ValorFixo,' ',MenosInf);<br />
ListBox1.enabled := True;<br />
ListBox1.Color := clWindow;<br />
ListBox1.Items.Clear;<br />
If M2>20 Then Form1.ListBox1.Items.Add('Arquivo Gran<strong>de</strong>. Visualize com WordPad');<br />
For I:=1 To M2 Do<br />
Begin<br />
Write(Re<strong>de</strong>,Link[I].ArcContra:5,' ');<br />
Frase:='';<br />
For J:=1 To M2 Do<br />
begin<br />
Write(Re<strong>de</strong>,L[I,J]+ValorFixo:5,' ');<br />
If M2