latex update
This commit is contained in:
parent
a3f0d3cbc5
commit
fc45c57510
|
@ -44,3 +44,28 @@ app.*.map.json
|
||||||
*/android/app/debug
|
*/android/app/debug
|
||||||
*/android/app/profile
|
*/android/app/profile
|
||||||
*/android/app/release
|
*/android/app/release
|
||||||
|
|
||||||
|
*.aux
|
||||||
|
*.glo
|
||||||
|
*.idx
|
||||||
|
*.log
|
||||||
|
*.toc
|
||||||
|
*.ist
|
||||||
|
*.acn
|
||||||
|
*.acr
|
||||||
|
*.alg
|
||||||
|
*.bbl
|
||||||
|
*.blg
|
||||||
|
*.dvi
|
||||||
|
*.glg
|
||||||
|
*.gls
|
||||||
|
*.ilg
|
||||||
|
*.ind
|
||||||
|
*.lof
|
||||||
|
*.lot
|
||||||
|
*.maf
|
||||||
|
*.mtc
|
||||||
|
*.mtc1
|
||||||
|
*.out
|
||||||
|
*.synctex.gz
|
||||||
|
*/_minted-example-work/
|
|
@ -25,54 +25,63 @@
|
||||||
\citation{Algo_2013}
|
\citation{Algo_2013}
|
||||||
\@writefile{toc}{\contentsline {section}{\numberline {1}\IeC {\CYRV }\IeC {\cyrv }\IeC {\cyre }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyre }}{4}{section.1}\protected@file@percent }
|
\@writefile{toc}{\contentsline {section}{\numberline {1}\IeC {\CYRV }\IeC {\cyrv }\IeC {\cyre }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyre }}{4}{section.1}\protected@file@percent }
|
||||||
\@writefile{toc}{\contentsline {subsection}{\numberline {1.1}\IeC {\CYRG }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrf }\IeC {\cyrery }}{4}{subsection.1.1}\protected@file@percent }
|
\@writefile{toc}{\contentsline {subsection}{\numberline {1.1}\IeC {\CYRG }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrf }\IeC {\cyrery }}{4}{subsection.1.1}\protected@file@percent }
|
||||||
|
\@writefile{toc}{\contentsline {subsection}{\numberline {1.2}\IeC {\CYRO }\IeC {\cyrs }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrv }\IeC {\cyrn }\IeC {\cyrery }\IeC {\cyre } \IeC {\cyro }\IeC {\cyrp }\IeC {\cyrr }\IeC {\cyre }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrl }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyrya }}{4}{subsection.1.2}\protected@file@percent }
|
||||||
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces \IeC {\CYRP }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrr } \IeC {\cyro }\IeC {\cyrr }\IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrf }\IeC {\cyra }\relax }}{4}{figure.caption.2}\protected@file@percent }
|
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces \IeC {\CYRP }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrr } \IeC {\cyro }\IeC {\cyrr }\IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrf }\IeC {\cyra }\relax }}{4}{figure.caption.2}\protected@file@percent }
|
||||||
\providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}}
|
\providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}}
|
||||||
\newlabel{fig:orgrapf_example}{{1}{4}{Ïðèìåð îðãðàôà\relax }{figure.caption.2}{}}
|
\newlabel{fig:orgrapf_example}{{1}{4}{Ïðèìåð îðãðàôà\relax }{figure.caption.2}{}}
|
||||||
|
\citation{intuit}
|
||||||
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces \IeC {\CYRP }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrr } \IeC {\cyrn }\IeC {\cyre }\IeC {\cyro }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyrt }\IeC {\cyri }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrv }\IeC {\cyra }\IeC {\cyrn }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyro } \IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrf }\IeC {\cyra }\relax }}{5}{figure.caption.3}\protected@file@percent }
|
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces \IeC {\CYRP }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrr } \IeC {\cyrn }\IeC {\cyre }\IeC {\cyro }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyrt }\IeC {\cyri }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrv }\IeC {\cyra }\IeC {\cyrn }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyro } \IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrf }\IeC {\cyra }\relax }}{5}{figure.caption.3}\protected@file@percent }
|
||||||
\newlabel{fig:grapf_example}{{2}{5}{Ïðèìåð íåîðèåíòèðîâàííîãî ãðàôà\relax }{figure.caption.3}{}}
|
\newlabel{fig:grapf_example}{{2}{5}{Ïðèìåð íåîðèåíòèðîâàííîãî ãðàôà\relax }{figure.caption.3}{}}
|
||||||
\@writefile{toc}{\contentsline {section}{\numberline {2}\IeC {\CYRI }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyro }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrya } \IeC {\cyrs }\IeC {\cyro }\IeC {\cyrz }\IeC {\cyrd }\IeC {\cyra }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyrya } \IeC {\cyrya }\IeC {\cyrz }\IeC {\cyrery }\IeC {\cyrk }\IeC {\cyra } SQL}{6}{section.2}\protected@file@percent }
|
\@writefile{toc}{\contentsline {subsection}{\numberline {1.3}\IeC {\CYRP }\IeC {\cyrr }\IeC {\cyre }\IeC {\cyrd }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyra }\IeC {\cyrv }\IeC {\cyrl }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyre } \IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrf }\IeC {\cyra }}{5}{subsection.1.3}\protected@file@percent }
|
||||||
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}\IeC {\CYRS }\IeC {\cyro }\IeC {\cyrz }\IeC {\cyrd }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyre }\IeC {\cyrl }\IeC {\cyri }}{6}{subsection.2.1}\protected@file@percent }
|
\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces \IeC {\CYRR }\IeC {\cyra }\IeC {\cyrs }\IeC {\cyrs }\IeC {\cyrm }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrv }\IeC {\cyra }\IeC {\cyre }\IeC {\cyrm }\IeC {\cyrery }\IeC {\cyrishrt } \IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrf }\relax }}{6}{figure.caption.4}\protected@file@percent }
|
||||||
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}\IeC {\CYRE }\IeC {\cyrshch }\IeC {\cyre } \IeC {\cyrerev }\IeC {\cyrl }\IeC {\cyre }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyrt }\IeC {\cyrery } \IeC {\cyrm }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyre }\IeC {\cyrm }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyri }\IeC {\cyrch }\IeC {\cyre }\IeC {\cyrs }\IeC {\cyrk }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyro } \IeC {\cyrt }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyra }}{6}{subsection.2.2}\protected@file@percent }
|
\newlabel{fig:graph_prim1}{{3}{6}{Ðàññìàòðèâàåìûé ãðàô\relax }{figure.caption.4}{}}
|
||||||
\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces \IeC {\CYRN }\IeC {\cyre }\IeC {\cyrishrt }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrn }\relax }}{6}{figure.caption.4}\protected@file@percent }
|
\@writefile{toc}{\contentsline {subsubsection}{\numberline {1.3.1}\IeC {\CYRP }\IeC {\cyre }\IeC {\cyrr }\IeC {\cyre }\IeC {\cyrch }\IeC {\cyri }\IeC {\cyrs }\IeC {\cyrl }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyre } \IeC {\cyrerev }\IeC {\cyrl }\IeC {\cyre }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyrt }\IeC {\cyro }\IeC {\cyrv }}{6}{subsubsection.1.3.1}\protected@file@percent }
|
||||||
\newlabel{neuron}{{3}{6}{Íåéðîí\relax }{figure.caption.4}{}}
|
\newlabel{ref:list}{{1.3.1}{6}{Ïåðå÷èñëåíèå ýëåìåíòîâ}{subsubsection.1.3.1}{}}
|
||||||
\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}\IeC {\CYRS }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrv }\IeC {\cyra } \IeC {\cyrm }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyre }\IeC {\cyrm }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyri }\IeC {\cyrch }\IeC {\cyre }\IeC {\cyrs }\IeC {\cyrk }\IeC {\cyri }\IeC {\cyrishrt } \IeC {\cyrt }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrs }\IeC {\cyrt }}{7}{subsection.2.3}\protected@file@percent }
|
\@writefile{toc}{\contentsline {subsubsection}{\numberline {1.3.2}\IeC {\CYRM }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrc }\IeC {\cyra } \IeC {\cyrs }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrzh }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyri }}{6}{subsubsection.1.3.2}\protected@file@percent }
|
||||||
\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces \IeC {\CYRA }\IeC {\cyrr }\IeC {\cyrh }\IeC {\cyri }\IeC {\cyrt }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrt }\IeC {\cyru }\IeC {\cyrr }\IeC {\cyra } \IeC {\cyrm }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrl }\IeC {\cyro }\IeC {\cyrishrt }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrishrt } \IeC {\cyrs }\IeC {\cyre }\IeC {\cyrt }\IeC {\cyri } \IeC {\cyrp }\IeC {\cyrr }\IeC {\cyrya }\IeC {\cyrm }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyro } \IeC {\cyrr }\IeC {\cyra }\IeC {\cyrs }\IeC {\cyrp }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrn }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyrya }\relax }}{8}{figure.caption.5}\protected@file@percent }
|
\newlabel{ref:smej}{{1.3.2}{6}{Ìàòðèöà ñìåæíîñòè}{subsubsection.1.3.2}{}}
|
||||||
\newlabel{net1}{{4}{8}{Àðõèòåêòóðà ìíîãîñëîéíîé ñåòè ïðÿìîãî ðàñïðîñòðàíåíèÿ\relax }{figure.caption.5}{}}
|
\@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces \IeC {\CYRP }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrr } \IeC {\cyrm }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrc }\IeC {\cyrery } \IeC {\cyrs }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrzh }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyri }\relax }}{6}{table.caption.5}\protected@file@percent }
|
||||||
\@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces \IeC {\CYRP }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrr } \IeC {\cyrn }\IeC {\cyre }\IeC {\cyrishrt }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrn }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrishrt } \IeC {\cyrs }\IeC {\cyre }\IeC {\cyrt }\IeC {\cyri }\relax }}{8}{figure.caption.6}\protected@file@percent }
|
\@writefile{toc}{\contentsline {subsubsection}{\numberline {1.3.3}\IeC {\CYRM }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrc }\IeC {\cyra } \IeC {\cyri }\IeC {\cyrn }\IeC {\cyrc }\IeC {\cyri }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyrt }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyri }}{6}{subsubsection.1.3.3}\protected@file@percent }
|
||||||
\newlabel{net2}{{5}{8}{Ïðèìåð íåéðîííîé ñåòè\relax }{figure.caption.6}{}}
|
\newlabel{ref:incident}{{1.3.3}{6}{Ìàòðèöà èíöèäåíòíîñòè}{subsubsection.1.3.3}{}}
|
||||||
\@writefile{toc}{\contentsline {section}{\numberline {3}\IeC {\CYRR }\IeC {\cyra }\IeC {\cyrz }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrl } \IeC {\cyrs } \IeC {\cyrp }\IeC {\cyro }\IeC {\cyrd }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrz }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrl }\IeC {\cyra }\IeC {\cyrm }\IeC {\cyri }}{9}{section.3}\protected@file@percent }
|
\@writefile{lot}{\contentsline {table}{\numberline {2}{\ignorespaces \IeC {\CYRP }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrr } \IeC {\cyrm }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrc }\IeC {\cyrery } \IeC {\cyri }\IeC {\cyrn }\IeC {\cyrc }\IeC {\cyri }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyrt }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyri }\relax }}{7}{table.caption.6}\protected@file@percent }
|
||||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}\IeC {\CYRT }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrs }\IeC {\cyrt } \IeC {\cyrs } \IeC {\cyrf }\IeC {\cyro }\IeC {\cyrr }\IeC {\cyrm }\IeC {\cyru }\IeC {\cyrl }\IeC {\cyra }\IeC {\cyrm }\IeC {\cyri } \IeC {\cyri } \IeC {\cyrl }\IeC {\cyre }\IeC {\cyrm }\IeC {\cyrm }\IeC {\cyro }\IeC {\cyrishrt }}{9}{subsection.3.1}\protected@file@percent }
|
\@writefile{toc}{\contentsline {subsubsection}{\numberline {1.3.4}\IeC {\CYRS }\IeC {\cyrp }\IeC {\cyri }\IeC {\cyrs }\IeC {\cyrk }\IeC {\cyri } \IeC {\cyrs }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrzh }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyri }}{7}{subsubsection.1.3.4}\protected@file@percent }
|
||||||
\newlabel{eq:ex01}{{1}{9}{Òåêñò ñ ôîðìóëàìè è ëåììîé}{equation.3.1}{}}
|
\newlabel{ref:spisok}{{1.3.4}{7}{Ñïèñêè ñìåæíîñòè}{subsubsection.1.3.4}{}}
|
||||||
\newlabel{lem:1}{{1}{9}{}{lem.1}{}}
|
\citation{dart_web}
|
||||||
\newlabel{it:1lem1}{{{1}}{9}{}{Item.1}{}}
|
\@writefile{toc}{\contentsline {section}{\numberline {2}\IeC {\CYRI }\IeC {\cyrn }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyru }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyrt }\IeC {\cyrery }}{8}{section.2}\protected@file@percent }
|
||||||
\newlabel{it:2lem1}{{{2}}{9}{}{Item.2}{}}
|
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Dart}{8}{subsection.2.1}\protected@file@percent }
|
||||||
\newlabel{eq:ex02}{{2}{9}{}{equation.3.2}{}}
|
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Flutter}{8}{subsection.2.2}\protected@file@percent }
|
||||||
\newlabel{eq:ex03}{{3}{9}{Òåêñò ñ ôîðìóëàìè è ëåììîé}{equation.3.3}{}}
|
\@writefile{toc}{\contentsline {section}{\numberline {3}\IeC {\CYRR }\IeC {\cyre }\IeC {\cyra }\IeC {\cyrl }\IeC {\cyri }\IeC {\cyrz }\IeC {\cyra }\IeC {\cyrc }\IeC {\cyri }\IeC {\cyrya }}{8}{section.3}\protected@file@percent }
|
||||||
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}\IeC {\CYRN }\IeC {\cyra }\IeC {\cyrz }\IeC {\cyrv }\IeC {\cyra }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyre } \IeC {\cyrd }\IeC {\cyrr }\IeC {\cyru }\IeC {\cyrg }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyro } \IeC {\cyrp }\IeC {\cyro }\IeC {\cyrd }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrz }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrl }\IeC {\cyra }}{10}{subsection.3.2}\protected@file@percent }
|
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}\IeC {\CYRT }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrs }\IeC {\cyrt } \IeC {\cyrs } \IeC {\cyrf }\IeC {\cyro }\IeC {\cyrr }\IeC {\cyrm }\IeC {\cyru }\IeC {\cyrl }\IeC {\cyra }\IeC {\cyrm }\IeC {\cyri } \IeC {\cyri } \IeC {\cyrl }\IeC {\cyre }\IeC {\cyrm }\IeC {\cyrm }\IeC {\cyro }\IeC {\cyrishrt }}{8}{subsection.3.1}\protected@file@percent }
|
||||||
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.2.1}\IeC {\CYRB }\IeC {\cyro }\IeC {\cyrl }\IeC {\cyre }\IeC {\cyre } \IeC {\cyrm }\IeC {\cyre }\IeC {\cyrl }\IeC {\cyrk }\IeC {\cyri }\IeC {\cyrishrt } \IeC {\cyrp }\IeC {\cyro }\IeC {\cyrd }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrz }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrl }}{10}{subsubsection.3.2.1}\protected@file@percent }
|
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}\IeC {\CYRN }\IeC {\cyra }\IeC {\cyrz }\IeC {\cyrv }\IeC {\cyra }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyre } \IeC {\cyrd }\IeC {\cyrr }\IeC {\cyru }\IeC {\cyrg }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyro } \IeC {\cyrp }\IeC {\cyro }\IeC {\cyrd }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrz }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrl }\IeC {\cyra }}{8}{subsection.3.2}\protected@file@percent }
|
||||||
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.2.2}\IeC {\CYRT }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrs }\IeC {\cyrt } \IeC {\cyrs } \IeC {\cyrt }\IeC {\cyra }\IeC {\cyrb }\IeC {\cyrl }\IeC {\cyri }\IeC {\cyrc }\IeC {\cyre }\IeC {\cyrishrt }}{10}{subsubsection.3.2.2}\protected@file@percent }
|
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.2.1}\IeC {\CYRB }\IeC {\cyro }\IeC {\cyrl }\IeC {\cyre }\IeC {\cyre } \IeC {\cyrm }\IeC {\cyre }\IeC {\cyrl }\IeC {\cyrk }\IeC {\cyri }\IeC {\cyrishrt } \IeC {\cyrp }\IeC {\cyro }\IeC {\cyrd }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrz }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrl }}{8}{subsubsection.3.2.1}\protected@file@percent }
|
||||||
\@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces \IeC {\CYRR }\IeC {\cyre }\IeC {\cyrz }\IeC {\cyru }\IeC {\cyrl }\IeC {\cyrsftsn }\IeC {\cyrt }\IeC {\cyra }\IeC {\cyrt } \IeC {\cyrs }\IeC {\cyro }\IeC {\cyrk }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrshch }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyrya } \IeC {\cyrs }\IeC {\cyrl }\IeC {\cyro }\IeC {\cyrv }\IeC {\cyra }\IeC {\cyrr }\IeC {\cyre }\IeC {\cyrishrt } \IeC {\cyrn }\IeC {\cyre }\IeC {\cyri }\IeC {\cyrs }\IeC {\cyrp }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrv }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyre }\IeC {\cyrishrt } \IeC {\cyrp }\IeC {\cyrr }\IeC {\cyri } \IeC {\cyrp }\IeC {\cyro }\IeC {\cyrm }\IeC {\cyro }\IeC {\cyrshch }\IeC {\cyri } \IeC {\cyrm }\IeC {\cyra }\IeC {\cyrs }\IeC {\cyro }\IeC {\cyrk }\relax }}{10}{table.caption.7}\protected@file@percent }
|
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.2.2}\IeC {\CYRT }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrs }\IeC {\cyrt } \IeC {\cyrs } \IeC {\cyrt }\IeC {\cyra }\IeC {\cyrb }\IeC {\cyrl }\IeC {\cyri }\IeC {\cyrc }\IeC {\cyre }\IeC {\cyrishrt }}{8}{subsubsection.3.2.2}\protected@file@percent }
|
||||||
\newlabel{table-1}{{1}{10}{Ðåçóëüòàò ñîêðàùåíèÿ ñëîâàðåé íåèñïðàâíîñòåé ïðè ïîìîùè ìàñîê\relax }{table.caption.7}{}}
|
\@writefile{lot}{\contentsline {table}{\numberline {3}{\ignorespaces \IeC {\CYRR }\IeC {\cyre }\IeC {\cyrz }\IeC {\cyru }\IeC {\cyrl }\IeC {\cyrsftsn }\IeC {\cyrt }\IeC {\cyra }\IeC {\cyrt } \IeC {\cyrs }\IeC {\cyro }\IeC {\cyrk }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrshch }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyrya } \IeC {\cyrs }\IeC {\cyrl }\IeC {\cyro }\IeC {\cyrv }\IeC {\cyra }\IeC {\cyrr }\IeC {\cyre }\IeC {\cyrishrt } \IeC {\cyrn }\IeC {\cyre }\IeC {\cyri }\IeC {\cyrs }\IeC {\cyrp }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrv }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyre }\IeC {\cyrishrt } \IeC {\cyrp }\IeC {\cyrr }\IeC {\cyri } \IeC {\cyrp }\IeC {\cyro }\IeC {\cyrm }\IeC {\cyro }\IeC {\cyrshch }\IeC {\cyri } \IeC {\cyrm }\IeC {\cyra }\IeC {\cyrs }\IeC {\cyro }\IeC {\cyrk }\relax }}{8}{table.caption.7}\protected@file@percent }
|
||||||
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.2.3}\IeC {\CYRT }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrs }\IeC {\cyrt } \IeC {\cyrs } \IeC {\cyrk }\IeC {\cyro }\IeC {\cyrd }\IeC {\cyro }\IeC {\cyrm } \IeC {\cyrp }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrm }\IeC {\cyrm }\IeC {\cyrery }}{11}{subsubsection.3.2.3}\protected@file@percent }
|
\newlabel{table-1}{{3}{8}{Ðåçóëüòàò ñîêðàùåíèÿ ñëîâàðåé íåèñïðàâíîñòåé ïðè ïîìîùè ìàñîê\relax }{table.caption.7}{}}
|
||||||
\@writefile{lot}{\contentsline {table}{\numberline {2}{\ignorespaces \IeC {\CYRM }\IeC {\cyra }\IeC {\cyrs }\IeC {\cyrs }\IeC {\cyri }\IeC {\cyrv }\IeC {\cyrery } \texttt {column}, \texttt {value} \IeC {\cyri } \texttt {rowIndex}\relax }}{12}{table.caption.8}\protected@file@percent }
|
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.2.3}\IeC {\CYRT }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrs }\IeC {\cyrt } \IeC {\cyrs } \IeC {\cyrk }\IeC {\cyro }\IeC {\cyrd }\IeC {\cyro }\IeC {\cyrm } \IeC {\cyrp }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrm }\IeC {\cyrm }\IeC {\cyrery }}{8}{subsubsection.3.2.3}\protected@file@percent }
|
||||||
\newlabel{tab:mat-arrays}{{2}{12}{Ìàññèâû \texttt {column}, \texttt {value} è \texttt {rowIndex}\relax }{table.caption.8}{}}
|
\@writefile{toc}{\contentsline {section}{\cyrillictext \CYRZ \CYRA \CYRK \CYRL \CYRYU \CYRCH \CYRE \CYRN \CYRI \CYRE }{8}{section*.8}\protected@file@percent }
|
||||||
\bibstyle{gost780uv}
|
\bibstyle{gost780uv}
|
||||||
\bibdata{thesis}
|
\bibdata{thesis}
|
||||||
\@writefile{toc}{\contentsline {section}{\cyrillictext \CYRZ \CYRA \CYRK \CYRL \CYRYU \CYRCH \CYRE \CYRN \CYRI \CYRE }{14}{section*.9}\protected@file@percent }
|
|
||||||
\bibcite{IITMMM_2017}{1}
|
\bibcite{IITMMM_2017}{1}
|
||||||
\bibcite{Algo_2013}{2}
|
\bibcite{Algo_2013}{2}
|
||||||
\@writefile{toc}{\contentsline {section}{\cyrillictext \CYRS \CYRP \CYRI \CYRS \CYRO \CYRK \ \CYRI \CYRS \CYRP \CYRO \CYRL \CYRSFTSN \CYRZ \CYRO \CYRV \CYRA \CYRN \CYRN \CYRERY \CYRH \ \CYRI \CYRS \CYRT \CYRO \CYRCH \CYRN \CYRI \CYRK \CYRO \CYRV }{15}{section*.10}\protected@file@percent }
|
\bibcite{intuit}{3}
|
||||||
|
\bibcite{dart_web}{4}
|
||||||
|
\@writefile{toc}{\contentsline {section}{\cyrillictext \CYRS \CYRP \CYRI \CYRS \CYRO \CYRK \ \CYRI \CYRS \CYRP \CYRO \CYRL \CYRSFTSN \CYRZ \CYRO \CYRV \CYRA \CYRN \CYRN \CYRERY \CYRH \ \CYRI \CYRS \CYRT \CYRO \CYRCH \CYRN \CYRI \CYRK \CYRO \CYRV }{10}{section*.9}\protected@file@percent }
|
||||||
\@writefile{toc}{\redeflsection }
|
\@writefile{toc}{\redeflsection }
|
||||||
\@writefile{toc}{\ttl@change@i {\@ne }{section}{3ex}{\hspace {-3ex}}{\appendixname ~\thecontentslabel \hspace {2ex}}{\hspace {2.3em}}{\titlerule *[0.98ex]{.}\contentspage }\relax }
|
\@writefile{toc}{\ttl@change@i {\@ne }{section}{3ex}{\hspace {-3ex}}{\appendixname ~\thecontentslabel \hspace {2ex}}{\hspace {2.3em}}{\titlerule *[0.98ex]{.}\contentspage }\relax }
|
||||||
\@writefile{toc}{\ttl@change@v {section}{}{}{}\relax }
|
\@writefile{toc}{\ttl@change@v {section}{}{}{}\relax }
|
||||||
\@writefile{toc}{\contentsline {section}{\numberline {\CYRA }\IeC {\CYRN }\IeC {\cyru }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrr }\IeC {\cyru }\IeC {\cyre }\IeC {\cyrm }\IeC {\cyrery }\IeC {\cyre } \IeC {\cyro }\IeC {\cyrb }\IeC {\cyrhrdsn }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrt }\IeC {\cyrery } \IeC {\cyrv } \IeC {\cyrp }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrl }\IeC {\cyro }\IeC {\cyrzh }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyri }}{16}{appendix.A}\protected@file@percent }
|
\@writefile{toc}{\contentsline {section}{\numberline {\CYRA }\IeC {\CYRK }\IeC {\cyro }\IeC {\cyrd } main.dart}{11}{appendix.A}\protected@file@percent }
|
||||||
\@writefile{lot}{\contentsline {table}{\numberline {3}{\ignorespaces Results of pass-fail dictionary reduction with the help of masks\relax }}{16}{table.caption.11}\protected@file@percent }
|
\newlabel{mainD}{{\CYRA }{11}{Êîä main.dart}{appendix.A}{}}
|
||||||
\newlabel{table-2}{{3}{16}{Results of pass-fail dictionary reduction with the help of masks\relax }{table.caption.11}{}}
|
\@writefile{toc}{\contentsline {section}{\numberline {\CYRB }\IeC {\CYRK }\IeC {\cyro }\IeC {\cyrd } \IeC {\cyrs }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyrc }\IeC {\cyrery } \IeC {\cyro }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrs }\IeC {\cyro }\IeC {\cyrv }\IeC {\cyrk }\IeC {\cyri }}{12}{appendix.B}\protected@file@percent }
|
||||||
\@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces \IeC {\CYRP }\IeC {\cyro }\IeC {\cyrd }\IeC {\cyrp }\IeC {\cyri }\IeC {\cyrs }\IeC {\cyrsftsn } \IeC {\cyrk } \IeC {\cyrr }\IeC {\cyri }\IeC {\cyrs }\IeC {\cyru }\IeC {\cyrn }\IeC {\cyrk }\IeC {\cyru }\relax }}{16}{figure.caption.12}\protected@file@percent }
|
\newlabel{buttons}{{\CYRB }{12}{Êîä ñòðàíèöû îòðèñîâêè}{appendix.B}{}}
|
||||||
\newlabel{fig:f3}{{6}{16}{Ïîäïèñü ê ðèñóíêó\relax }{figure.caption.12}{}}
|
\@writefile{toc}{\contentsline {section}{\numberline {\CYRV }\IeC {\CYRK }\IeC {\cyro }\IeC {\cyrd } \IeC {\cyro }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrs }\IeC {\cyro }\IeC {\cyrv }\IeC {\cyrk }\IeC {\cyri } \IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrf }\IeC {\cyra }}{23}{appendix.C}\protected@file@percent }
|
||||||
\@writefile{lot}{\contentsline {table}{\numberline {4}{\ignorespaces \relax }}{16}{table.caption.13}\protected@file@percent }
|
\newlabel{painter}{{\CYRV }{23}{Êîä îòðèñîâêè ãðàôà}{appendix.C}{}}
|
||||||
\@writefile{toc}{\contentsline {section}{\numberline {\CYRB }\IeC {\CYRL }\IeC {\cyri }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyri }\IeC {\cyrn }\IeC {\cyrg } \IeC {\cyrp }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrm }\IeC {\cyrm }\IeC {\cyrery }}{17}{appendix.B}\protected@file@percent }
|
\@writefile{toc}{\contentsline {section}{\numberline {\CYRG }\IeC {\CYRK }\IeC {\cyro }\IeC {\cyrd } \IeC {\cyrk }\IeC {\cyrl }\IeC {\cyra }\IeC {\cyrs }\IeC {\cyrs }\IeC {\cyra } \IeC {\cyrd }\IeC {\cyrl }\IeC {\cyrya } \IeC {\cyrr }\IeC {\cyra }\IeC {\cyrb }\IeC {\cyro }\IeC {\cyrt }\IeC {\cyrery } \IeC {\cyrs } \IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrf }\IeC {\cyro }\IeC {\cyrm }}{30}{appendix.D}\protected@file@percent }
|
||||||
\newlabel{pril-1}{{\CYRB }{17}{Ëèñòèíã ïðîãðàììû}{appendix.B}{}}
|
\newlabel{graph}{{\CYRG }{30}{Êîä êëàññà äëÿ ðàáîòû ñ ãðàôîì}{appendix.D}{}}
|
||||||
\@writefile{toc}{\contentsline {section}{\numberline {\CYRV }\IeC {\CYRM }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyrch }\IeC {\cyrn }\IeC {\cyra }\IeC {\cyrya } \IeC {\cyrt }\IeC {\cyra }\IeC {\cyrb }\IeC {\cyrl }\IeC {\cyri }\IeC {\cyrc }\IeC {\cyra }}{19}{appendix.C}\protected@file@percent }
|
\gdef\minted@oldcachelist{,
|
||||||
|
default-pyg-prefix.pygstyle,
|
||||||
|
default.pygstyle,
|
||||||
|
548449C97F6698D1087AC91A858CF238CE04D0281233DEC882812002753B51D5.pygtex,
|
||||||
|
F63A6C6CFE2A71C32A62566A5FF402950791E7A7418ABF68C6F476205A17F326.pygtex,
|
||||||
|
E0D93F1B1C464B10E1DFD3A5FDD7CB2DE3F55DFCBF3BE5E86CD03B6A6A01C07B.pygtex,
|
||||||
|
61D1074515C38F77A84FF03851DA34D2D1904B5EABA5B13629C0C626E1849883.pygtex}
|
||||||
\ttl@finishall
|
\ttl@finishall
|
||||||
\gdef \@abspage@last{19}
|
\gdef \@abspage@last{44}
|
||||||
|
|
|
@ -21,7 +21,20 @@
|
||||||
\BibAuthor{Кормен,~Томас~Х.} \BibTitle{Алгоритмы: построение и анализ, 2-е
|
\BibAuthor{Кормен,~Томас~Х.} \BibTitle{Алгоритмы: построение и анализ, 2-е
|
||||||
издание}~/ Томас~Х.~Кормен, Чарльз~И.~Лейзерсон, Роналд~Л.~Ривест,
|
издание}~/ Томас~Х.~Кормен, Чарльз~И.~Лейзерсон, Роналд~Л.~Ривест,
|
||||||
Клиффорд~Штайн. "---
|
Клиффорд~Штайн. "---
|
||||||
\newblock Издательский дом \"Вильямс\", 2013. "---
|
\newblock Èçäàòåëüñêèé äîì ''Âèëüÿìñ'', 2013. "---
|
||||||
\newblock P.~1296.
|
\newblock P.~1296.
|
||||||
|
|
||||||
|
\bibitem{intuit}
|
||||||
|
\selectlanguageifdefined{english}
|
||||||
|
\BibTitle{Ëåêöèÿ 45: Àëãîðèòìû íà ãðàôàõ. àëãîðèòìû îáõîäà ãðàôa.
|
||||||
|
[{Ý}ëåêòðîííûé ðåñóðñ]}. "---
|
||||||
|
\newblock URL:~\url{https://intuit.ru/studies/courses/648/504/lecture/11474}
|
||||||
|
(Äàòà îáðàùåíèÿ 20.11.2021). Çàãë. ñ ýêð. ßç. ðóñ.
|
||||||
|
|
||||||
|
\bibitem{dart_web}
|
||||||
|
\selectlanguageifdefined{english}
|
||||||
|
\BibTitle{Dart overview. [{Ý}ëåêòðîííûé ðåñóðñ]}. "---
|
||||||
|
\newblock URL:~\url{https://dart.dev/overview} (Äàòà îáðàùåíèÿ 20.11.2021).
|
||||||
|
Çàãë. ñ ýêð. ßç. àíãë.
|
||||||
|
|
||||||
\end{thebibliography}
|
\end{thebibliography}
|
||||||
|
|
|
@ -11,9 +11,9 @@ Reallocated glb_str_end (elt_size=4) to 10 items from 0.
|
||||||
Database file #1: thesis.bib
|
Database file #1: thesis.bib
|
||||||
|
|
||||||
Here's how much of BibTeX's memory you used:
|
Here's how much of BibTeX's memory you used:
|
||||||
Cites: 2 out of 750
|
Cites: 4 out of 750
|
||||||
Fields: 34 out of 5000
|
Fields: 96 out of 5000
|
||||||
Hash table: 18794 out of 19000
|
Hash table: 18792 out of 19000
|
||||||
Strings: 665 out of 19000
|
Strings: 671 out of 19000
|
||||||
Free string pool: 5758 out of 65000
|
Free string pool: 6092 out of 65000
|
||||||
Wizard functions: 2649 out of 3000
|
Wizard functions: 2649 out of 3000
|
||||||
|
|
|
@ -1,18 +1,24 @@
|
||||||
\BOOKMARK [1][-]{section*.1}{\376\377\004\022\004\022\004\025\004\024\004\025\004\035\004\030\004\025}{}% 1
|
\BOOKMARK [1][-]{section*.1}{\376\377\004\022\004\022\004\025\004\024\004\025\004\035\004\030\004\025}{}% 1
|
||||||
\BOOKMARK [1][-]{section.1}{\376\377\004\022\004\062\004\065\004\064\004\065\004\075\004\070\004\065}{}% 2
|
\BOOKMARK [1][-]{section.1}{\376\377\004\022\004\062\004\065\004\064\004\065\004\075\004\070\004\065}{}% 2
|
||||||
\BOOKMARK [2][-]{subsection.1.1}{\376\377\004\023\004\100\004\060\004\104\004\113}{section.1}% 3
|
\BOOKMARK [2][-]{subsection.1.1}{\376\377\004\023\004\100\004\060\004\104\004\113}{section.1}% 3
|
||||||
\BOOKMARK [1][-]{section.2}{\376\377\004\030\004\101\004\102\004\076\004\100\004\070\004\117\000\040\004\101\004\076\004\067\004\064\004\060\004\075\004\070\004\117\000\040\004\117\004\067\004\113\004\072\004\060\000\040\000S\000Q\000L}{}% 4
|
\BOOKMARK [2][-]{subsection.1.2}{\376\377\004\036\004\101\004\075\004\076\004\062\004\075\004\113\004\065\000\040\004\076\004\077\004\100\004\065\004\064\004\065\004\073\004\065\004\075\004\070\004\117}{section.1}% 4
|
||||||
\BOOKMARK [2][-]{subsection.2.1}{\376\377\004\041\004\076\004\067\004\064\004\060\004\102\004\065\004\073\004\070}{section.2}% 5
|
\BOOKMARK [2][-]{subsection.1.3}{\376\377\004\037\004\100\004\065\004\064\004\101\004\102\004\060\004\062\004\073\004\065\004\075\004\070\004\065\000\040\004\063\004\100\004\060\004\104\004\060}{section.1}% 5
|
||||||
\BOOKMARK [2][-]{subsection.2.2}{\376\377\004\025\004\111\004\065\000\040\004\115\004\073\004\065\004\074\004\065\004\075\004\102\004\113\000\040\004\074\004\060\004\102\004\065\004\074\004\060\004\102\004\070\004\107\004\065\004\101\004\072\004\076\004\063\004\076\000\040\004\102\004\065\004\072\004\101\004\102\004\060}{section.2}% 6
|
\BOOKMARK [3][-]{subsubsection.1.3.1}{\376\377\004\037\004\065\004\100\004\065\004\107\004\070\004\101\004\073\004\065\004\075\004\070\004\065\000\040\004\115\004\073\004\065\004\074\004\065\004\075\004\102\004\076\004\062}{subsection.1.3}% 6
|
||||||
\BOOKMARK [2][-]{subsection.2.3}{\376\377\004\041\004\075\004\076\004\062\004\060\000\040\004\074\004\060\004\102\004\065\004\074\004\060\004\102\004\070\004\107\004\065\004\101\004\072\004\070\004\071\000\040\004\102\004\065\004\072\004\101\004\102}{section.2}% 7
|
\BOOKMARK [3][-]{subsubsection.1.3.2}{\376\377\004\034\004\060\004\102\004\100\004\070\004\106\004\060\000\040\004\101\004\074\004\065\004\066\004\075\004\076\004\101\004\102\004\070}{subsection.1.3}% 7
|
||||||
\BOOKMARK [1][-]{section.3}{\376\377\004\040\004\060\004\067\004\064\004\065\004\073\000\040\004\101\000\040\004\077\004\076\004\064\004\100\004\060\004\067\004\064\004\065\004\073\004\060\004\074\004\070}{}% 8
|
\BOOKMARK [3][-]{subsubsection.1.3.3}{\376\377\004\034\004\060\004\102\004\100\004\070\004\106\004\060\000\040\004\070\004\075\004\106\004\070\004\064\004\065\004\075\004\102\004\075\004\076\004\101\004\102\004\070}{subsection.1.3}% 8
|
||||||
\BOOKMARK [2][-]{subsection.3.1}{\376\377\004\042\004\065\004\072\004\101\004\102\000\040\004\101\000\040\004\104\004\076\004\100\004\074\004\103\004\073\004\060\004\074\004\070\000\040\004\070\000\040\004\073\004\065\004\074\004\074\004\076\004\071}{section.3}% 9
|
\BOOKMARK [3][-]{subsubsection.1.3.4}{\376\377\004\041\004\077\004\070\004\101\004\072\004\070\000\040\004\101\004\074\004\065\004\066\004\075\004\076\004\101\004\102\004\070}{subsection.1.3}% 9
|
||||||
\BOOKMARK [2][-]{subsection.3.2}{\376\377\004\035\004\060\004\067\004\062\004\060\004\075\004\070\004\065\000\040\004\064\004\100\004\103\004\063\004\076\004\063\004\076\000\040\004\077\004\076\004\064\004\100\004\060\004\067\004\064\004\065\004\073\004\060}{section.3}% 10
|
\BOOKMARK [1][-]{section.2}{\376\377\004\030\004\075\004\101\004\102\004\100\004\103\004\074\004\065\004\075\004\102\004\113}{}% 10
|
||||||
\BOOKMARK [3][-]{subsubsection.3.2.1}{\376\377\004\021\004\076\004\073\004\065\004\065\000\040\004\074\004\065\004\073\004\072\004\070\004\071\000\040\004\077\004\076\004\064\004\100\004\060\004\067\004\064\004\065\004\073}{subsection.3.2}% 11
|
\BOOKMARK [2][-]{subsection.2.1}{\376\377\000D\000a\000r\000t}{section.2}% 11
|
||||||
\BOOKMARK [3][-]{subsubsection.3.2.2}{\376\377\004\042\004\065\004\072\004\101\004\102\000\040\004\101\000\040\004\102\004\060\004\061\004\073\004\070\004\106\004\065\004\071}{subsection.3.2}% 12
|
\BOOKMARK [2][-]{subsection.2.2}{\376\377\000F\000l\000u\000t\000t\000e\000r}{section.2}% 12
|
||||||
\BOOKMARK [3][-]{subsubsection.3.2.3}{\376\377\004\042\004\065\004\072\004\101\004\102\000\040\004\101\000\040\004\072\004\076\004\064\004\076\004\074\000\040\004\077\004\100\004\076\004\063\004\100\004\060\004\074\004\074\004\113}{subsection.3.2}% 13
|
\BOOKMARK [1][-]{section.3}{\376\377\004\040\004\065\004\060\004\073\004\070\004\067\004\060\004\106\004\070\004\117}{}% 13
|
||||||
\BOOKMARK [1][-]{section*.9}{\376\377\004\027\004\020\004\032\004\033\004\056\004\047\004\025\004\035\004\030\004\025}{}% 14
|
\BOOKMARK [2][-]{subsection.3.1}{\376\377\004\042\004\065\004\072\004\101\004\102\000\040\004\101\000\040\004\104\004\076\004\100\004\074\004\103\004\073\004\060\004\074\004\070\000\040\004\070\000\040\004\073\004\065\004\074\004\074\004\076\004\071}{section.3}% 14
|
||||||
\BOOKMARK [1][-]{section*.10}{\376\377\004\041\004\037\004\030\004\041\004\036\004\032\000\040\004\030\004\041\004\037\004\036\004\033\004\054\004\027\004\036\004\022\004\020\004\035\004\035\004\053\004\045\000\040\004\030\004\041\004\042\004\036\004\047\004\035\004\030\004\032\004\036\004\022}{}% 15
|
\BOOKMARK [2][-]{subsection.3.2}{\376\377\004\035\004\060\004\067\004\062\004\060\004\075\004\070\004\065\000\040\004\064\004\100\004\103\004\063\004\076\004\063\004\076\000\040\004\077\004\076\004\064\004\100\004\060\004\067\004\064\004\065\004\073\004\060}{section.3}% 15
|
||||||
\BOOKMARK [1][-]{appendix.A}{\376\377\004\035\004\103\004\074\004\065\004\100\004\103\004\065\004\074\004\113\004\065\000\040\004\076\004\061\004\112\004\065\004\072\004\102\004\113\000\040\004\062\000\040\004\077\004\100\004\070\004\073\004\076\004\066\004\065\004\075\004\070\004\070}{}% 16
|
\BOOKMARK [3][-]{subsubsection.3.2.1}{\376\377\004\021\004\076\004\073\004\065\004\065\000\040\004\074\004\065\004\073\004\072\004\070\004\071\000\040\004\077\004\076\004\064\004\100\004\060\004\067\004\064\004\065\004\073}{subsection.3.2}% 16
|
||||||
\BOOKMARK [1][-]{appendix.B}{\376\377\004\033\004\070\004\101\004\102\004\070\004\075\004\063\000\040\004\077\004\100\004\076\004\063\004\100\004\060\004\074\004\074\004\113}{}% 17
|
\BOOKMARK [3][-]{subsubsection.3.2.2}{\376\377\004\042\004\065\004\072\004\101\004\102\000\040\004\101\000\040\004\102\004\060\004\061\004\073\004\070\004\106\004\065\004\071}{subsection.3.2}% 17
|
||||||
\BOOKMARK [1][-]{appendix.C}{\376\377\004\034\004\075\004\076\004\063\004\076\004\101\004\102\004\100\004\060\004\075\004\070\004\107\004\075\004\060\004\117\000\040\004\102\004\060\004\061\004\073\004\070\004\106\004\060}{}% 18
|
\BOOKMARK [3][-]{subsubsection.3.2.3}{\376\377\004\042\004\065\004\072\004\101\004\102\000\040\004\101\000\040\004\072\004\076\004\064\004\076\004\074\000\040\004\077\004\100\004\076\004\063\004\100\004\060\004\074\004\074\004\113}{subsection.3.2}% 18
|
||||||
|
\BOOKMARK [1][-]{section*.8}{\376\377\004\027\004\020\004\032\004\033\004\056\004\047\004\025\004\035\004\030\004\025}{}% 19
|
||||||
|
\BOOKMARK [1][-]{section*.9}{\376\377\004\041\004\037\004\030\004\041\004\036\004\032\000\040\004\030\004\041\004\037\004\036\004\033\004\054\004\027\004\036\004\022\004\020\004\035\004\035\004\053\004\045\000\040\004\030\004\041\004\042\004\036\004\047\004\035\004\030\004\032\004\036\004\022}{}% 20
|
||||||
|
\BOOKMARK [1][-]{appendix.A}{\376\377\004\032\004\076\004\064\000\040\000m\000a\000i\000n\000.\000d\000a\000r\000t}{}% 21
|
||||||
|
\BOOKMARK [1][-]{appendix.B}{\376\377\004\032\004\076\004\064\000\040\004\101\004\102\004\100\004\060\004\075\004\070\004\106\004\113\000\040\004\076\004\102\004\100\004\070\004\101\004\076\004\062\004\072\004\070}{}% 22
|
||||||
|
\BOOKMARK [1][-]{appendix.C}{\376\377\004\032\004\076\004\064\000\040\004\076\004\102\004\100\004\070\004\101\004\076\004\062\004\072\004\070\000\040\004\063\004\100\004\060\004\104\004\060}{}% 23
|
||||||
|
\BOOKMARK [1][-]{appendix.D}{\376\377\004\032\004\076\004\064\000\040\004\072\004\073\004\060\004\101\004\101\004\060\000\040\004\064\004\073\004\117\000\040\004\100\004\060\004\061\004\076\004\102\004\113\000\040\004\101\000\040\004\063\004\100\004\060\004\104\004\076\004\074}{}% 24
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -116,7 +116,7 @@
|
||||||
|
|
||||||
% Раздел "Введение"
|
% Раздел "Введение"
|
||||||
\intro
|
\intro
|
||||||
Целью настоящей работы является изучение работы фреймворка для кроссплатформенной разработки "Flutter", и разработка приложения для создания графов и взаимодействия с ними.
|
Целью настоящей работы является изучение работы фреймворка для кроссплатформенной разработки "Flutter" и разработка приложения для создания графов и взаимодействия с ними.
|
||||||
|
|
||||||
Поставлены задачи:
|
Поставлены задачи:
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
|
@ -132,6 +132,8 @@
|
||||||
графа. Другое множество состоит из пар вершин, эти пары называются
|
графа. Другое множество состоит из пар вершин, эти пары называются
|
||||||
\textit{ребрами} графа.~\cite{IITMMM_2017}
|
\textit{ребрами} графа.~\cite{IITMMM_2017}
|
||||||
|
|
||||||
|
\subsection{Основные определения}
|
||||||
|
|
||||||
\textbf{Ориентированный граф} определяется как пара \textit{(V, E)}, где \textit{V} --- конечное множество, а \textit{E} --- бинарное отношение на \textit{V}, т.~е. подмножество множества ${V \times V}$. Ориентированный граф для краткости называют \textbf{орграфом}. Множетсво $V$ называют \textbf{множеством вершин графа}, а его элемент называют \textbf{вершиной} графа. Множество $E$ называют \textbf{множеством рёбер}, а его элементы называют \textbf{рёбрами}. Граф может содержать \textbf{рёбра-циклы}, соединяющие вершину с собой. На рисунке~\ref{fig:orgrapf_example} изображен оринетированный граф с множеством вершин \{0, 1, 2, 3, 4\}.~\citenum{Algo_2013}
|
\textbf{Ориентированный граф} определяется как пара \textit{(V, E)}, где \textit{V} --- конечное множество, а \textit{E} --- бинарное отношение на \textit{V}, т.~е. подмножество множества ${V \times V}$. Ориентированный граф для краткости называют \textbf{орграфом}. Множетсво $V$ называют \textbf{множеством вершин графа}, а его элемент называют \textbf{вершиной} графа. Множество $E$ называют \textbf{множеством рёбер}, а его элементы называют \textbf{рёбрами}. Граф может содержать \textbf{рёбра-циклы}, соединяющие вершину с собой. На рисунке~\ref{fig:orgrapf_example} изображен оринетированный граф с множеством вершин \{0, 1, 2, 3, 4\}.~\citenum{Algo_2013}
|
||||||
|
|
||||||
\begin{figure}[!ht]
|
\begin{figure}[!ht]
|
||||||
|
@ -150,224 +152,106 @@
|
||||||
Пример неориентированного графа}
|
Пример неориентированного графа}
|
||||||
\end{figure}
|
\end{figure}
|
||||||
|
|
||||||
\section{История создания языка SQL}
|
|
||||||
\subsection{Создатели}
|
|
||||||
Создателями языка SQL являются Реймонд Боус (англ. Ray Boyce) и Дональд Чемберлин (англ. Donald Chamberlin)
|
|
||||||
|
|
||||||
|
Вершина \textit{v} \textbf{смежна} с вершиной \textit{u}, если в графе имеется ребро $\{u, v\}$. Для неориентированных графов отношение смежности является симметричным, но для ориентированных графов это не обязательно.
|
||||||
|
|
||||||
|
\textbf{Степенью} вершины в неориентированном графе называется число инцидентных ей рёбер. Для ориентированного графа различают исходящую степень, определяемую как число выходящих из неё рёбер, и входящую степень, определяемую как число входящих в неё рёбер. Сумма исходяшей и входящей степеней называется степенью вершины.
|
||||||
|
|
||||||
\subsection{Еще элементы математического текста}
|
\textbf{Маршрутом} в графе называется конечная чередующаяся последовательность смежных вершин и ребер, соединяющих эти вершины.
|
||||||
Нейрон является составной частью нейронной сети. Он состоит из
|
|
||||||
элементов трех типов: умножителей (синапсов), сумматора и
|
|
||||||
нелинейного преобразователя. Синапсы осуществляют связь между
|
|
||||||
нейронами, умножают входной сигнал на число, характеризующее силу
|
|
||||||
связи (вес синапса). Сумматор выполняет сложение сигналов,
|
|
||||||
поступающих по синаптическим связям от других нейронов, и внешних
|
|
||||||
входных сигналов. Нелинейный преобразователь реализует нелинейную
|
|
||||||
функцию одного аргумента "--- выхода сумматора. Эта функция
|
|
||||||
называется функцией активации или передаточной функцией. На рисунке~\ref{neuron} приведено строение одного нейрона.
|
|
||||||
|
|
||||||
Нейрон в целом реализует скалярную функцию векторного аргумента.
|
Маршрут называется открытым, если его начальная и конечная вершины различны, в противном случае он называется замкнутым.
|
||||||
Математическая модель нейрона:
|
|
||||||
\[
|
Маршрут называется \textbf{цепью}, если все его ребра различны. Открытая цепь называется \textbf{путем}, если все ее вершины различны.
|
||||||
s = \sum\limits_{i = 1}^n w_i x_i + b,
|
|
||||||
\]
|
Замкнутая цепь называется \textbf{циклом}, если различны все ее вершины, за исключением концевых.
|
||||||
\[
|
|
||||||
y = f(s),
|
Граф называется \textbf{связным}, если для любой пары вершин существует соединяющий их путь.~\cite{intuit}
|
||||||
\]
|
|
||||||
где $w_i $ "--- вес синапса; $i = 1,\ldots ,n$; $b$ "--- значение
|
\subsection{Представление графа}
|
||||||
смещения; $s$ "--- результат суммирования; $x_i $ "--- $i$-тый
|
Граф можно описать несколькими способами.
|
||||||
компонент входного вектора (входной сигнал), \linebreak $i = 1,\ldots, n$;
|
|
||||||
$y$ "--- выходной сигнал нейрона; $n$ "--- число входов нейрона;
|
\begin{enumerate}
|
||||||
$f(s)$ "--- нелинейное преобразование (функция активации).
|
\item Перечисление элементов:~\ref{ref:list}.
|
||||||
\begin{figure}[ht]
|
\item Матрица смежности:~\ref{ref:smej}.
|
||||||
|
\item Матрица инцидентности:~\ref{ref:incident}.
|
||||||
|
\item Список смежности:~\ref{ref:spisok}.
|
||||||
|
\end{enumerate}
|
||||||
|
|
||||||
|
Рассмотрим на примере графа на рисунке~\ref{fig:graph_prim1}.
|
||||||
|
|
||||||
|
\begin{figure}
|
||||||
\centering
|
\centering
|
||||||
%\includegraphics{Neuron}
|
\includegraphics[width=9cm]{./pic/prim1.png}
|
||||||
\caption{Нейрон}\label{neuron}
|
\caption{\label{fig:graph_prim1}
|
||||||
|
Рассматриваемый граф}
|
||||||
\end{figure}
|
\end{figure}
|
||||||
|
|
||||||
В качестве функции активации нейронов берут обычно одну из
|
\subsubsection{Перечисление элементов}\label{ref:list}
|
||||||
следующих:
|
Исходя из определения, для того, чтобы задать граф, достаточно перечислить его вершины и ребра (т.е. пары вершин).
|
||||||
|
|
||||||
|
Пример:
|
||||||
|
$$ V = \{a, b, c, d, e\} $$
|
||||||
|
$$ E = \{(a, b), (a, c), (a, e), (b, c), (b, d), (c, e), (d, e)\}$$
|
||||||
|
|
||||||
|
\subsubsection{Матрица смежности}\label{ref:smej}
|
||||||
|
Пусть $G$ --- граф с $n$ вершинами, пронумерованными числами от 1 до $n$. \textbf{Матрица смежности} --- это таблица с $n$ строками и $n$ столбцами, в которой элемент, стоящий на пересечении строки с номером $i$ и столбца с номером $j$, равен 1, еcли вершины с номерами $i$ и $j$ смежны, и 0, если они не смежны.
|
||||||
|
|
||||||
|
\begin{table}[!ht]
|
||||||
|
%\centering
|
||||||
|
\caption{Пример матрицы смежности}
|
||||||
|
\begin{tabular}{|p{15pt}|p{15pt}|p{15pt}|p{15pt}|p{15pt}|}
|
||||||
|
\hline 0 & 1 & 1 & 0 & 1\\
|
||||||
|
\hline 1 & 0 & 1 & 1 & 0\\
|
||||||
|
\hline 1 & 1 & 0 & 0 & 1\\
|
||||||
|
\hline 0 & 1 & 0 & 0 & 1\\
|
||||||
|
\hline 1 & 0 & 1 & 1 & 0\\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\subsubsection{Матрица инцидентности}\label{ref:incident}
|
||||||
|
|
||||||
|
Пусть $G$ --- граф с вершинами, пронумерованными числами от 1 до $n$, и ребрами, пронумеровнными от 1 до $m$. В матрице инцидентности строки соответствуют вершинам, а столбцы рёбрам. На пересечении строки с номером $i$ и столбца с номером $j$ стоит 1, если вершина с номером $i$ инцидентна ребру с номером $j$, и 0 в противном случае.
|
||||||
|
|
||||||
|
\begin{table}[!ht]
|
||||||
|
%\centering
|
||||||
|
\caption{Пример матрицы инцидентности}
|
||||||
|
\begin{tabular}{|p{15pt}|p{15pt}|p{15pt}|p{15pt}|p{15pt}|p{15pt}|p{15pt}|}
|
||||||
|
\hline 1 & 1 & 1 & 0 & 0 & 0 & 0\\
|
||||||
|
\hline 1 & 0 & 0 & 1 & 1 & 0 & 0\\
|
||||||
|
\hline 0 & 1 & 0 & 1 & 0 & 1 & 0\\
|
||||||
|
\hline 0 & 0 & 0 & 0 & 1 & 0 & 1\\
|
||||||
|
\hline 0 & 0 & 1 & 0 & 0 & 1 & 1\\
|
||||||
|
\hline
|
||||||
|
\end{tabular}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\subsubsection{Списки смежности}\label{ref:spisok}
|
||||||
|
Списки смежности часто используются для компьютерного представления графов. Для каждой вершины задается список всех смежных с ней вершин. В структурах данных, применяемых в программировании, списки смежности могут быть реализованы как массив линейных списков.
|
||||||
|
|
||||||
|
Указывается номер или имя вершины и перечисляются все смежные с ней вершины.
|
||||||
|
|
||||||
|
Пример:
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item пороговая функция активации;
|
\item[1] : 2, 3, 5
|
||||||
\item экспоненциальная сигмоида;
|
\item[2] : 1, 3, 4
|
||||||
\item рациональная сигмоида;
|
\item[3] : 1, 2, 5
|
||||||
\item гиперболический тангенс.
|
\item[4] : 2, 5
|
||||||
|
\item[5] : 1, 3, 4
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
Данные функции активации обладают таким важным свойством как
|
\section{Инструменты}
|
||||||
нелинейность. Нелинейность функции активации принципиальна для
|
Рассмотрим используемый язык и библиотеку для отрисовки.
|
||||||
построения нейронных сетей. Если бы нейроны были линейными
|
\subsection{Dart}
|
||||||
элементами, то любая последовательность нейронов также производила
|
В качестве основы используется язык \textbf{Dart}, разработанный компанией Google, и широко используемый для кросс-платформенной разработки~\cite{dart_web}.
|
||||||
бы линейное преобразование и вся нейронная сеть была бы
|
\subsection{Flutter}
|
||||||
эквивалентна одному нейрону (или одному слою нейронов в случае
|
|
||||||
нескольких выходов). Нелинейность разрушает суперпозицию и
|
|
||||||
приводит к тому, что возможности нейросети существенно выше
|
|
||||||
возможностей отдельных нейронов.
|
|
||||||
|
|
||||||
\subsection{Снова математический текст}
|
\section{Реализация}
|
||||||
Опишем самую популярную архитектуру
|
|
||||||
"--- многослойный персептрон с последовательными связями и
|
|
||||||
сигмоидальной функцией активации (\foreignlanguage{english}{Feedforward Artifitial Neural
|
|
||||||
Network, FANN}).
|
|
||||||
|
|
||||||
В многослойных нейронных сетях с последовательными связями нейроны
|
|
||||||
делятся на группы с общим входным сигналом "--- слои. Стандартная
|
|
||||||
сеть состоит из $L$ слоев, пронумерованных слева направо. Каждый
|
|
||||||
слой содержит совокупность нейронов с едиными входными сигналами.
|
|
||||||
Внешние входные сигналы подаются на входы нейронов входного слоя
|
|
||||||
(его часто нумеруют как нулевой), а выходами сети являются
|
|
||||||
выходные сигналы последнего слоя. Кроме входного и выходного слоев
|
|
||||||
в многослойной нейронной сети есть один или несколько скрытых
|
|
||||||
слоев, соединенных последовательно в прямом направлении и не
|
|
||||||
содержащих связей между элементами внутри слоя и обратных связей
|
|
||||||
между слоями. Число нейронов в слое может быть любым и не зависит
|
|
||||||
от количества нейронов в других слоях. Архитектура нейронной сети
|
|
||||||
прямого распространения сигнала приведена на рисунке~\ref{net1}.
|
|
||||||
|
|
||||||
На каждый нейрон первого слоя подаются все элементы внешнего
|
|
||||||
входного сигнала. Все выходы нейронов $i$-го слоя подаются на
|
|
||||||
каждый нейрон слоя $i+1$.
|
|
||||||
|
|
||||||
Нейроны выполняют взвешенное суммирование элементов входных
|
|
||||||
сигналов. К сумме прибавляется смещение нейрона. Над результатом
|
|
||||||
суммирования выполняется нелинейное преобразование "--- функция
|
|
||||||
активации (передаточная функция). Значение функции активации есть
|
|
||||||
выход нейрона. Приведем схему многослойного персептрона. Нейроны
|
|
||||||
представлены кружками, связи между нейронами "--- линиями со
|
|
||||||
стрелками.
|
|
||||||
|
|
||||||
\begin{figure}[ht]
|
|
||||||
\centering
|
|
||||||
%\includegraphics{NN-Scheme}
|
|
||||||
\caption{Архитектура многослойной сети прямого
|
|
||||||
распространения}\label{net1}
|
|
||||||
\end{figure}
|
|
||||||
|
|
||||||
Функционирование сети выполняется в соответствии с формулами:
|
|
||||||
\[
|
|
||||||
s_j^{\left[ k \right]} = \sum\limits_{i = 1}^{N_{k - 1} }
|
|
||||||
{w_{ji}^{\left[ k \right]} y_i^{\left[ {k - 1} \right]} +
|
|
||||||
b_j^{[k]} ,\ \ j = 1,\ldots ,N_k ,\ \ k = 1,\ldots ,L;}
|
|
||||||
\]
|
|
||||||
\[
|
|
||||||
y_j^{\left[ k \right]} = f(s_j^{\left[ k \right]} ),\ \ j =
|
|
||||||
1,\ldots ,N_k ,\ \ k = 1,\ldots ,L-1,
|
|
||||||
\]
|
|
||||||
\[
|
|
||||||
y_j^{\left[ L \right]} = s_j^{\left[ L \right]} ,
|
|
||||||
\]
|
|
||||||
где
|
|
||||||
\begin{itemize}
|
|
||||||
\item
|
|
||||||
$y_i^{\left[ {k - 1} \right]}$ "--- выходной сигнал $i$-го нейрона
|
|
||||||
$(k - 1)$-го слоя; \item $w_{ji}^{\left[ k \right]}$ "--- вес связи
|
|
||||||
между $j$-м нейроном слоя $(k-1)$ и $i$-м нейроном $k$-го
|
|
||||||
слоя;
|
|
||||||
\item
|
|
||||||
$b_j^{\left[ k \right]}$ "--- значение смещения $j$-го
|
|
||||||
нейрона $k$-го слоя;
|
|
||||||
\item
|
|
||||||
$y = f(s)$ "--- функция активации;
|
|
||||||
\item
|
|
||||||
$y_j^{\left[ k \right]}$ "--- выходной сигнал $j$-го
|
|
||||||
нейрона $k$-го слоя;
|
|
||||||
\item
|
|
||||||
$N_k$ "--- число узлов слоя $k$;
|
|
||||||
\item
|
|
||||||
$L$ "--- общее число основных слоев;
|
|
||||||
\item
|
|
||||||
$n = N_0$ "--- размерность входного вектора;
|
|
||||||
\item
|
|
||||||
$m = N_L$ "---
|
|
||||||
размерность выходного вектора сети.
|
|
||||||
\end{itemize}
|
|
||||||
|
|
||||||
На рисунке~\ref{net2} представлена сеть прямого распространения
|
|
||||||
сигнала с 5 входами, 3 нейронами в скрытом слое и 2 нейронами в
|
|
||||||
выходном слое.
|
|
||||||
\begin{figure}[hb]
|
|
||||||
\centering
|
|
||||||
%\includegraphics{NN-Persep}
|
|
||||||
\caption{Пример нейронной сети}\label{net2}
|
|
||||||
\end{figure}
|
|
||||||
|
|
||||||
|
|
||||||
\section{Раздел с подразделами}
|
|
||||||
\subsection{Текст с формулами и леммой}
|
\subsection{Текст с формулами и леммой}
|
||||||
|
|
||||||
Обозначим $[y_0,y_1,\ldots,y_p;f]$ разделенную разность порядка $p$ функции $f$ по узлам $y_0<y_1<\ldots<y_p$.
|
|
||||||
|
|
||||||
Обозначим $L_pf(x;y_0,y_1,\ldots,y_p)$ интерполяционный полином Ньютона функции $f$ по узлам $y_0,y_1,\ldots,y_p$:
|
|
||||||
\begin{equation} \label{eq:ex01}
|
|
||||||
L_pf(x;y_0,y_1,\ldots,y_p)=\sum_{j=0}^p[y_0, \ldots,y_{j};f]
|
|
||||||
\cdot \prod_{i=0}^{j-1}(x-y_i), \ \ x-y_{-1}\eqdef 1
|
|
||||||
\end{equation}
|
|
||||||
|
|
||||||
\begin{lem} \label{lem:1}
|
|
||||||
Если $0\leqslant x_0<x_1<\ldots <x_p\leqslant 1$ и
|
|
||||||
$f\in C[0,1]$ удовлетворяет условиям
|
|
||||||
\begin{enumerate}
|
|
||||||
\item
|
|
||||||
\label{it:1lem1}$f(x)\geqslant 0, \ x\in [0,1]$;
|
|
||||||
\item
|
|
||||||
\label{it:2lem1}
|
|
||||||
$[y_0,\ldots,y_{p+1};f]\geqslant 0$
|
|
||||||
для всех $y_i \in [0,1], \
|
|
||||||
i=0,\ldots,p+1,$
|
|
||||||
\end{enumerate}
|
|
||||||
тогда
|
|
||||||
\begin{equation}\label{eq:ex02}
|
|
||||||
L_pf(x;x_0,\ldots,x_p)\geqslant 0
|
|
||||||
\end{equation}
|
|
||||||
для всех $x\in [x_{p-(2k+1)},x_{p-2k}]$,
|
|
||||||
$k=0,\ldots,\left[p/2\right]$,
|
|
||||||
$x_{-1} \eqdef -\infty$.
|
|
||||||
\end{lem}
|
|
||||||
\begin{proof}
|
|
||||||
Возьмем $x \in [x_{p-(2k+1)},x_{p-2k}]$,\ \ $k=0,\ldots,\left[p/2
|
|
||||||
\right]$.
|
|
||||||
|
|
||||||
Из условия \ref{lem:1} леммы следует, что
|
|
||||||
\begin{displaymath}
|
|
||||||
[x_0,\ldots,x_{p-(2k+1)},x,x_{p-2k},\ldots,x_p;f] \geqslant
|
|
||||||
0,
|
|
||||||
\end{displaymath}
|
|
||||||
т.~е.
|
|
||||||
\begin{multline}\label{eq:ex03}
|
|
||||||
\Delta_pf(x;x_0,\ldots,x_p)\eqdef
|
|
||||||
\\ \eqdef
|
|
||||||
\begin{vmatrix}
|
|
||||||
1 & x_0 & x_0^2 & \cdots & x_0^p & f(x_0) \\
|
|
||||||
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
|
|
||||||
1 & x_{p-(2k+1)} & x_{p-(2k+1)}^2 & \cdots & x_{p-(2k+1)}^p & f(x_{p-(2k+1)}) \\
|
|
||||||
1 & x & x^2 & \cdots & x^p & f(x) \\
|
|
||||||
1 & x_{p-2k} & x_{p-2k}^2 & \cdots & x_{p-2k}^p & f(x_{p-2k}) \\
|
|
||||||
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
|
|
||||||
1 & x_p & x_p^2 & \cdots & x_p^p & f(x_p) \\
|
|
||||||
\end{vmatrix}
|
|
||||||
\geqslant 0
|
|
||||||
\end{multline}
|
|
||||||
|
|
||||||
Из равенства
|
|
||||||
\begin{equation*}
|
|
||||||
\Delta_p f(x;x_0,\ldots,x_p)=(L_pf(x;x_0,\ldots,x_p)-f(x))
|
|
||||||
\prod_{0\leqslant i<j\leqslant p}(x_j-x_i).
|
|
||||||
\end{equation*}
|
|
||||||
и \eqref{eq:ex03} следует, что
|
|
||||||
\begin{displaymath}
|
|
||||||
L_pf(x;x_0,\ldots,x_p)\geqslant f(x).
|
|
||||||
\end{displaymath}
|
|
||||||
|
|
||||||
С учетом условия \ref{it:1lem1} леммы мы получаем утверждение \eqref{eq:ex02}.
|
|
||||||
\end{proof}
|
|
||||||
|
|
||||||
\subsection{Название другого подраздела}
|
\subsection{Название другого подраздела}
|
||||||
\subsubsection{Более мелкий подраздел}
|
\subsubsection{Более мелкий подраздел}
|
||||||
Если разность энергий электронно"=дырочных уровней $E_2-E_1$ близка к энергии предельного оптического фонона $\hbar\Omega_{LO}$, то в разложении волновых функций полного гамильтониана можно ограничиться нулевым приближением для всех состояний, за исключением близких по значению к $E_2$.
|
|
||||||
|
|
||||||
\subsubsection{Текст с таблицей}
|
\subsubsection{Текст с таблицей}
|
||||||
В таблице~\ref{table-1} представлены результаты сокращения словарей неисправностей для схем из каталога ISCAS'89.
|
|
||||||
|
|
||||||
\begin{table}[!ht]
|
\begin{table}[!ht]
|
||||||
\small
|
\small
|
||||||
|
@ -395,64 +279,6 @@ Network, FANN}).
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
\subsubsection{Текст с кодом программы}
|
\subsubsection{Текст с кодом программы}
|
||||||
Термин <<разреженная матрица>> впервые был предложен Гарри Марковицем. В 1989 он был награжден премией имени Джона фон Неймана в том числе и за вклад в теорию методов для разреженных матриц.
|
|
||||||
|
|
||||||
В большинстве источников, разреженной матрицей называется матрица, в которой мало ненулевых элементов. Это нельзя назвать определением из-за слова <<мало>>. В понятие разреженной матрицы определяется так: <<Мы можем называть матрицу разреженной, если применение к ней методов, описываемых в книге, экономит память и/или время>>. Таким образом, следует дать определение алгоритму для разреженных матриц. Алгоритмом для разреженных матриц будем называть алгоритм, у которого время работы и необходимый объем памяти зависят от количества ненулевых элементов в матрице.
|
|
||||||
|
|
||||||
Размерность квадратной матрицы $A$ будем обозначать $n$, а количество ненулевых элементов в ней $|A|$.
|
|
||||||
|
|
||||||
Плотные матрицы обычно хранятся в качестве двумерного массива $n\times n$. Будем обозначать такой массив a. Разреженные матрицы не стоит хранить таким способом из-за слишком большого потребления памяти, которая будет занята в основном нулевыми элементами.
|
|
||||||
|
|
||||||
Один из вариантов представления разреженных матриц в памяти компьютера "--- в виде трех массивов: \verb"column", \verb"value" и \verb"rowIndex". Размеры массивов \verb"column" и \verb"value" равны $|A|$. Размер \verb"rowIndex" равен $n+1$. Ненулевые элементы матрицы $A$ хранятся последовательно по строкам в этих массивах. Элемент \verb"column[i]" содержит номер столбца, в котором содержится \verb"i"-й ненулевой элемент, а \verb"value[i]" "--- его величину. Массив \verb"rowIndex[i]" содержит в себе индекс первого ненулевого элемента \verb"i"-й строки. Все ненулевые элементы \verb"i"-й строки содержатся в массивах \verb"column" и \verb"value" в элементах с индексами от \verb"rowIndex[i]" по \verb"rowIndex[i + 1]-1". Для удобства полагают \verb"rowIndex["$n$\verb"]"$=|A|$.
|
|
||||||
|
|
||||||
Для примера рассмотрим следующую матрицу:
|
|
||||||
\[
|
|
||||||
\left(
|
|
||||||
\begin{matrix}
|
|
||||||
1 & 0 & 5 & 0 & 0 \\
|
|
||||||
0 & 2 & 7 & 4 & 0 \\
|
|
||||||
0 & 0 & 1 & 0 & 0 \\
|
|
||||||
9 & 6 & 0 & 3 & 0 \\
|
|
||||||
0 & 0 & 3 & 0 & 5
|
|
||||||
\end{matrix}
|
|
||||||
\right)
|
|
||||||
\]
|
|
||||||
|
|
||||||
Массивы \verb"column", \verb"value" и \verb"rowIndex" для этой матрицы представлены в таблице~\ref{tab:mat-arrays}.
|
|
||||||
\begin{table}[ht]\small
|
|
||||||
\caption{Массивы \texttt{column}, \texttt{value} и \texttt{rowIndex}}\label{tab:mat-arrays}
|
|
||||||
\begin{tabular}{|l|c|c|c|c|c|c|c|c|c|c|c|c|} \cline{2-13}
|
|
||||||
\multicolumn{1}{c|}{} & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 \\ \cline{2-13}\hline
|
|
||||||
\verb"column" & 0 & 2 & 1 & 2 & 3 & 2 & 0 & 1 & 3 & 2 & 4 & \\ \hline\hline
|
|
||||||
\verb"value" & 1 & 5 & 2 & 7 & 4 & 1 & 9 & 6 & 3 & 3 & 5 & \\ \hline\hline
|
|
||||||
\verb"rowIndex" & 0 & 2 & 5 & 6 & 9 & 11 & & & & & & \\ \hline
|
|
||||||
\end{tabular}
|
|
||||||
\end{table}
|
|
||||||
|
|
||||||
Неизвестный вектор и вектор правой части хранятся в виде массивов размера $n$. Массив неизвестного вектора обозначают \verb"x", а массив правой части "--- \verb"rhs".
|
|
||||||
|
|
||||||
Рассмотрим пример алгоритма для разреженных матриц. Алгоритм решения СЛАУ, представленной нижнетреугольной матрицей \verb"a", можно реализовать двумя вложенными циклами по \verb"n":
|
|
||||||
\begin{Verbatim}[fontsize=\small, numbers=left]
|
|
||||||
for(int i = 0; i $<$ n; ++i){
|
|
||||||
x[i] = rhs[i];
|
|
||||||
for(int j = 0; j $<$ i; ++j)
|
|
||||||
x[i] -= a[i][j] * x[j];
|
|
||||||
x[i] /= a[i][i];
|
|
||||||
}
|
|
||||||
\end{Verbatim}
|
|
||||||
|
|
||||||
Но, если матрица \verb"a" хранится в разреженном виде, то в данном алгоритме можно проходить только по ненулевым элементам \verb"a":
|
|
||||||
\begin{Verbatim}[fontsize=\small, numbers=left]
|
|
||||||
for(int i = 0; i $<$ n; ++i){
|
|
||||||
x[i] = rhs[i];
|
|
||||||
for(int j = rowIndex[i]; j $<$ rowIndex[i + 1] - 1; ++j)
|
|
||||||
x[i] -= value[j] * x[column[j]];
|
|
||||||
x[i] /= value[rowIndex[i + 1] - 1];
|
|
||||||
}
|
|
||||||
\end{Verbatim}
|
|
||||||
В первом случае оценка времени работы будет $O(n^{2})$, а во втором $O(|A|)$.
|
|
||||||
|
|
||||||
Методы для разреженных матриц основаны на следующих главных принципах
|
|
||||||
|
|
||||||
|
|
||||||
% Раздел "Заключение"
|
% Раздел "Заключение"
|
||||||
|
@ -482,78 +308,21 @@ for(int i = 0; i $<$ n; ++i){
|
||||||
% Каждая последующая секция документа будет являться приложением
|
% Каждая последующая секция документа будет являться приложением
|
||||||
\appendix
|
\appendix
|
||||||
|
|
||||||
\section{Нумеруемые объекты в приложении}
|
\section{Код main.dart}\label{mainD}
|
||||||
|
Точка входа в программу.
|
||||||
|
\inputminted[fontsize=\footnotesize, linenos]{dart}{./lib/main.dart}
|
||||||
|
|
||||||
\begin{table}[!ht]
|
\section{Код страницы отрисовки}\label{buttons}
|
||||||
\footnotesize
|
Описание интерфейса и базовые функции для взаимодействия с информацией.
|
||||||
\caption{Results of pass-fail dictionary reduction with the help
|
\inputminted[fontsize=\footnotesize, linenos]{dart}{./lib/pages/drawing_page.dart}
|
||||||
of masks} \label{table-2}
|
|
||||||
\begin{tabular}{|p{1.5cm}|
|
|
||||||
p{1.5cm}|
|
|
||||||
p{1.5cm}|
|
|
||||||
p{1.5cm}|
|
|
||||||
p{1cm}|
|
|
||||||
p{1.5cm}|
|
|
||||||
p{1.5cm}|
|
|
||||||
p{1cm}|}
|
|
||||||
\hline \centering Circuit & Number of modelled faults & Number of test
|
|
||||||
vectors in the test set & The volume of pass-fail dictionary,
|
|
||||||
\linebreak bit & The volume of found mask & The volume of
|
|
||||||
masked dictionary, \linebreak bit & \raggedright \% of pass-fail dictionary
|
|
||||||
& CPU running time, \linebreak min
|
|
||||||
\\
|
|
||||||
\hline S298 & 177 & 322 & 56994 & 30 & 5310 & 9,32\% & 0,07\\
|
|
||||||
\hline S344 & 240 & 127 & 30480 & 29 & 6960 & 22,83\% & 0,04\\
|
|
||||||
\hline S349 & 243 & 134 & 32562 & 35 & 8505 & 26,12\% & 0,05\\
|
|
||||||
\hline S382 & 190 & 2074 & 394060 & 28 & 5320 & 1,35\% & 0,43\\
|
|
||||||
\hline S386 & 274 & 286 & 78364 & 65 & 17810 & 22,73\% & 0,26\\
|
|
||||||
\hline S400 & 194 & 2214 & 429516 & 32 & 6208 & 1,45\% & 0,99\\
|
|
||||||
\hline S444 & 191 & 2240 & 427840 & 30 & 5730 & 1,34\% & 0,98\\
|
|
||||||
\hline S526 & 138 & 2258 & 311604 & 28 & 3864 & 1,24\% & 0,61\\
|
|
||||||
\hline S641 & 345 & 209 & 72105 & 58 & 20010 & 27,75\% & 0,24\\
|
|
||||||
\hline S713 & 343 & 173 & 59339 & 58 & 19894 & 33,53\% & 0,19\\
|
|
||||||
\hline S820 & 712 & 1115 & 793880 & 147 & 104664 & 13,18\% & 9,09\\
|
|
||||||
\hline S832 & 719 & 1137 & 817503 & 151 & 108569 & 13,28\% & 9,20\\
|
|
||||||
\hline S953 & 326 & 14 & 4564 & 13 & 4238 & 92,86\% & 0,01\\
|
|
||||||
\hline S1423 & 293 & 150 & 43950 & 58 & 16994 & 38,67\% & 0,15\\
|
|
||||||
\hline S1488 & 1359 & 1170 & 1590030 & 158 & 214722 & 13,50\% & 26,69\\
|
|
||||||
\hline
|
|
||||||
\end{tabular}
|
|
||||||
\end{table}
|
|
||||||
|
|
||||||
\begin{equation}
|
\section{Код отрисовки графа}\label{painter}
|
||||||
F(x)=\int\limits_a^bf(x)\,dx.
|
Выводит на экран информацияю из графа.
|
||||||
\end{equation}
|
\inputminted[fontsize=\footnotesize, linenos]{dart}{./lib/src/curve_painter.dart}
|
||||||
|
|
||||||
|
\section{Код класса для работы с графом}\label{graph}
|
||||||
\begin{figure}[!ht]
|
Основной класс для хранения и взаимодействия с информацией.
|
||||||
\centering
|
\inputminted[fontsize=\footnotesize, linenos]{dart}{./lib/src/graph.dart}
|
||||||
\includegraphics[width=6cm]{fig2.png}
|
|
||||||
\caption{\label{fig:f3}%
|
|
||||||
Подпись к рисунку}
|
|
||||||
\end{figure}
|
|
||||||
|
|
||||||
|
|
||||||
\begin{table}[!ht]
|
|
||||||
\caption{}
|
|
||||||
\begin{tabular}{|c|c|}
|
|
||||||
\hline
|
|
||||||
0 & 1\cr
|
|
||||||
\hline
|
|
||||||
1 & 0\cr
|
|
||||||
\hline
|
|
||||||
\end{tabular}
|
|
||||||
\end{table}
|
|
||||||
|
|
||||||
|
|
||||||
\section{Листинг программы}\label{pril-1}
|
|
||||||
Код приложения \verb"task.pl".
|
|
||||||
|
|
||||||
\VerbatimInput[fontsize=\small, numbers=left, numbersep=2pt]{task.pl}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\section{Многостраничная таблица}
|
|
||||||
|
|
||||||
\noindent
|
\noindent
|
||||||
|
|
||||||
|
|
|
@ -2,22 +2,28 @@
|
||||||
\contentsline {section}{\cyrillictext \CYRV \CYRV \CYRE \CYRD \CYRE \CYRN \CYRI \CYRE }{3}{section*.1}%
|
\contentsline {section}{\cyrillictext \CYRV \CYRV \CYRE \CYRD \CYRE \CYRN \CYRI \CYRE }{3}{section*.1}%
|
||||||
\contentsline {section}{\numberline {1}\IeC {\CYRV }\IeC {\cyrv }\IeC {\cyre }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyre }}{4}{section.1}%
|
\contentsline {section}{\numberline {1}\IeC {\CYRV }\IeC {\cyrv }\IeC {\cyre }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyre }}{4}{section.1}%
|
||||||
\contentsline {subsection}{\numberline {1.1}\IeC {\CYRG }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrf }\IeC {\cyrery }}{4}{subsection.1.1}%
|
\contentsline {subsection}{\numberline {1.1}\IeC {\CYRG }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrf }\IeC {\cyrery }}{4}{subsection.1.1}%
|
||||||
\contentsline {section}{\numberline {2}\IeC {\CYRI }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyro }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrya } \IeC {\cyrs }\IeC {\cyro }\IeC {\cyrz }\IeC {\cyrd }\IeC {\cyra }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyrya } \IeC {\cyrya }\IeC {\cyrz }\IeC {\cyrery }\IeC {\cyrk }\IeC {\cyra } SQL}{6}{section.2}%
|
\contentsline {subsection}{\numberline {1.2}\IeC {\CYRO }\IeC {\cyrs }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrv }\IeC {\cyrn }\IeC {\cyrery }\IeC {\cyre } \IeC {\cyro }\IeC {\cyrp }\IeC {\cyrr }\IeC {\cyre }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrl }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyrya }}{4}{subsection.1.2}%
|
||||||
\contentsline {subsection}{\numberline {2.1}\IeC {\CYRS }\IeC {\cyro }\IeC {\cyrz }\IeC {\cyrd }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyre }\IeC {\cyrl }\IeC {\cyri }}{6}{subsection.2.1}%
|
\contentsline {subsection}{\numberline {1.3}\IeC {\CYRP }\IeC {\cyrr }\IeC {\cyre }\IeC {\cyrd }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyra }\IeC {\cyrv }\IeC {\cyrl }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyre } \IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrf }\IeC {\cyra }}{5}{subsection.1.3}%
|
||||||
\contentsline {subsection}{\numberline {2.2}\IeC {\CYRE }\IeC {\cyrshch }\IeC {\cyre } \IeC {\cyrerev }\IeC {\cyrl }\IeC {\cyre }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyrt }\IeC {\cyrery } \IeC {\cyrm }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyre }\IeC {\cyrm }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyri }\IeC {\cyrch }\IeC {\cyre }\IeC {\cyrs }\IeC {\cyrk }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyro } \IeC {\cyrt }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyra }}{6}{subsection.2.2}%
|
\contentsline {subsubsection}{\numberline {1.3.1}\IeC {\CYRP }\IeC {\cyre }\IeC {\cyrr }\IeC {\cyre }\IeC {\cyrch }\IeC {\cyri }\IeC {\cyrs }\IeC {\cyrl }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyre } \IeC {\cyrerev }\IeC {\cyrl }\IeC {\cyre }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyrt }\IeC {\cyro }\IeC {\cyrv }}{6}{subsubsection.1.3.1}%
|
||||||
\contentsline {subsection}{\numberline {2.3}\IeC {\CYRS }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrv }\IeC {\cyra } \IeC {\cyrm }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyre }\IeC {\cyrm }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyri }\IeC {\cyrch }\IeC {\cyre }\IeC {\cyrs }\IeC {\cyrk }\IeC {\cyri }\IeC {\cyrishrt } \IeC {\cyrt }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrs }\IeC {\cyrt }}{7}{subsection.2.3}%
|
\contentsline {subsubsection}{\numberline {1.3.2}\IeC {\CYRM }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrc }\IeC {\cyra } \IeC {\cyrs }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrzh }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyri }}{6}{subsubsection.1.3.2}%
|
||||||
\contentsline {section}{\numberline {3}\IeC {\CYRR }\IeC {\cyra }\IeC {\cyrz }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrl } \IeC {\cyrs } \IeC {\cyrp }\IeC {\cyro }\IeC {\cyrd }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrz }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrl }\IeC {\cyra }\IeC {\cyrm }\IeC {\cyri }}{9}{section.3}%
|
\contentsline {subsubsection}{\numberline {1.3.3}\IeC {\CYRM }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrc }\IeC {\cyra } \IeC {\cyri }\IeC {\cyrn }\IeC {\cyrc }\IeC {\cyri }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyrt }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyri }}{6}{subsubsection.1.3.3}%
|
||||||
\contentsline {subsection}{\numberline {3.1}\IeC {\CYRT }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrs }\IeC {\cyrt } \IeC {\cyrs } \IeC {\cyrf }\IeC {\cyro }\IeC {\cyrr }\IeC {\cyrm }\IeC {\cyru }\IeC {\cyrl }\IeC {\cyra }\IeC {\cyrm }\IeC {\cyri } \IeC {\cyri } \IeC {\cyrl }\IeC {\cyre }\IeC {\cyrm }\IeC {\cyrm }\IeC {\cyro }\IeC {\cyrishrt }}{9}{subsection.3.1}%
|
\contentsline {subsubsection}{\numberline {1.3.4}\IeC {\CYRS }\IeC {\cyrp }\IeC {\cyri }\IeC {\cyrs }\IeC {\cyrk }\IeC {\cyri } \IeC {\cyrs }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrzh }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyri }}{7}{subsubsection.1.3.4}%
|
||||||
\contentsline {subsection}{\numberline {3.2}\IeC {\CYRN }\IeC {\cyra }\IeC {\cyrz }\IeC {\cyrv }\IeC {\cyra }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyre } \IeC {\cyrd }\IeC {\cyrr }\IeC {\cyru }\IeC {\cyrg }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyro } \IeC {\cyrp }\IeC {\cyro }\IeC {\cyrd }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrz }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrl }\IeC {\cyra }}{10}{subsection.3.2}%
|
\contentsline {section}{\numberline {2}\IeC {\CYRI }\IeC {\cyrn }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyru }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyrt }\IeC {\cyrery }}{8}{section.2}%
|
||||||
\contentsline {subsubsection}{\numberline {3.2.1}\IeC {\CYRB }\IeC {\cyro }\IeC {\cyrl }\IeC {\cyre }\IeC {\cyre } \IeC {\cyrm }\IeC {\cyre }\IeC {\cyrl }\IeC {\cyrk }\IeC {\cyri }\IeC {\cyrishrt } \IeC {\cyrp }\IeC {\cyro }\IeC {\cyrd }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrz }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrl }}{10}{subsubsection.3.2.1}%
|
\contentsline {subsection}{\numberline {2.1}Dart}{8}{subsection.2.1}%
|
||||||
\contentsline {subsubsection}{\numberline {3.2.2}\IeC {\CYRT }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrs }\IeC {\cyrt } \IeC {\cyrs } \IeC {\cyrt }\IeC {\cyra }\IeC {\cyrb }\IeC {\cyrl }\IeC {\cyri }\IeC {\cyrc }\IeC {\cyre }\IeC {\cyrishrt }}{10}{subsubsection.3.2.2}%
|
\contentsline {subsection}{\numberline {2.2}Flutter}{8}{subsection.2.2}%
|
||||||
\contentsline {subsubsection}{\numberline {3.2.3}\IeC {\CYRT }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrs }\IeC {\cyrt } \IeC {\cyrs } \IeC {\cyrk }\IeC {\cyro }\IeC {\cyrd }\IeC {\cyro }\IeC {\cyrm } \IeC {\cyrp }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrm }\IeC {\cyrm }\IeC {\cyrery }}{11}{subsubsection.3.2.3}%
|
\contentsline {section}{\numberline {3}\IeC {\CYRR }\IeC {\cyre }\IeC {\cyra }\IeC {\cyrl }\IeC {\cyri }\IeC {\cyrz }\IeC {\cyra }\IeC {\cyrc }\IeC {\cyri }\IeC {\cyrya }}{8}{section.3}%
|
||||||
\contentsline {section}{\cyrillictext \CYRZ \CYRA \CYRK \CYRL \CYRYU \CYRCH \CYRE \CYRN \CYRI \CYRE }{14}{section*.9}%
|
\contentsline {subsection}{\numberline {3.1}\IeC {\CYRT }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrs }\IeC {\cyrt } \IeC {\cyrs } \IeC {\cyrf }\IeC {\cyro }\IeC {\cyrr }\IeC {\cyrm }\IeC {\cyru }\IeC {\cyrl }\IeC {\cyra }\IeC {\cyrm }\IeC {\cyri } \IeC {\cyri } \IeC {\cyrl }\IeC {\cyre }\IeC {\cyrm }\IeC {\cyrm }\IeC {\cyro }\IeC {\cyrishrt }}{8}{subsection.3.1}%
|
||||||
\contentsline {section}{\cyrillictext \CYRS \CYRP \CYRI \CYRS \CYRO \CYRK \ \CYRI \CYRS \CYRP \CYRO \CYRL \CYRSFTSN \CYRZ \CYRO \CYRV \CYRA \CYRN \CYRN \CYRERY \CYRH \ \CYRI \CYRS \CYRT \CYRO \CYRCH \CYRN \CYRI \CYRK \CYRO \CYRV }{15}{section*.10}%
|
\contentsline {subsection}{\numberline {3.2}\IeC {\CYRN }\IeC {\cyra }\IeC {\cyrz }\IeC {\cyrv }\IeC {\cyra }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyre } \IeC {\cyrd }\IeC {\cyrr }\IeC {\cyru }\IeC {\cyrg }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyro } \IeC {\cyrp }\IeC {\cyro }\IeC {\cyrd }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrz }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrl }\IeC {\cyra }}{8}{subsection.3.2}%
|
||||||
|
\contentsline {subsubsection}{\numberline {3.2.1}\IeC {\CYRB }\IeC {\cyro }\IeC {\cyrl }\IeC {\cyre }\IeC {\cyre } \IeC {\cyrm }\IeC {\cyre }\IeC {\cyrl }\IeC {\cyrk }\IeC {\cyri }\IeC {\cyrishrt } \IeC {\cyrp }\IeC {\cyro }\IeC {\cyrd }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrz }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrl }}{8}{subsubsection.3.2.1}%
|
||||||
|
\contentsline {subsubsection}{\numberline {3.2.2}\IeC {\CYRT }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrs }\IeC {\cyrt } \IeC {\cyrs } \IeC {\cyrt }\IeC {\cyra }\IeC {\cyrb }\IeC {\cyrl }\IeC {\cyri }\IeC {\cyrc }\IeC {\cyre }\IeC {\cyrishrt }}{8}{subsubsection.3.2.2}%
|
||||||
|
\contentsline {subsubsection}{\numberline {3.2.3}\IeC {\CYRT }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrs }\IeC {\cyrt } \IeC {\cyrs } \IeC {\cyrk }\IeC {\cyro }\IeC {\cyrd }\IeC {\cyro }\IeC {\cyrm } \IeC {\cyrp }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrm }\IeC {\cyrm }\IeC {\cyrery }}{8}{subsubsection.3.2.3}%
|
||||||
|
\contentsline {section}{\cyrillictext \CYRZ \CYRA \CYRK \CYRL \CYRYU \CYRCH \CYRE \CYRN \CYRI \CYRE }{8}{section*.8}%
|
||||||
|
\contentsline {section}{\cyrillictext \CYRS \CYRP \CYRI \CYRS \CYRO \CYRK \ \CYRI \CYRS \CYRP \CYRO \CYRL \CYRSFTSN \CYRZ \CYRO \CYRV \CYRA \CYRN \CYRN \CYRERY \CYRH \ \CYRI \CYRS \CYRT \CYRO \CYRCH \CYRN \CYRI \CYRK \CYRO \CYRV }{10}{section*.9}%
|
||||||
\redeflsection
|
\redeflsection
|
||||||
\ttl@change@i {\@ne }{section}{3ex}{\hspace {-3ex}}{\appendixname ~\thecontentslabel \hspace {2ex}}{\hspace {2.3em}}{\titlerule *[0.98ex]{.}\contentspage }\relax
|
\ttl@change@i {\@ne }{section}{3ex}{\hspace {-3ex}}{\appendixname ~\thecontentslabel \hspace {2ex}}{\hspace {2.3em}}{\titlerule *[0.98ex]{.}\contentspage }\relax
|
||||||
\ttl@change@v {section}{}{}{}\relax
|
\ttl@change@v {section}{}{}{}\relax
|
||||||
\contentsline {section}{\numberline {\CYRA }\IeC {\CYRN }\IeC {\cyru }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrr }\IeC {\cyru }\IeC {\cyre }\IeC {\cyrm }\IeC {\cyrery }\IeC {\cyre } \IeC {\cyro }\IeC {\cyrb }\IeC {\cyrhrdsn }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrt }\IeC {\cyrery } \IeC {\cyrv } \IeC {\cyrp }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrl }\IeC {\cyro }\IeC {\cyrzh }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyri }}{16}{appendix.A}%
|
\contentsline {section}{\numberline {\CYRA }\IeC {\CYRK }\IeC {\cyro }\IeC {\cyrd } main.dart}{11}{appendix.A}%
|
||||||
\contentsline {section}{\numberline {\CYRB }\IeC {\CYRL }\IeC {\cyri }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyri }\IeC {\cyrn }\IeC {\cyrg } \IeC {\cyrp }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrm }\IeC {\cyrm }\IeC {\cyrery }}{17}{appendix.B}%
|
\contentsline {section}{\numberline {\CYRB }\IeC {\CYRK }\IeC {\cyro }\IeC {\cyrd } \IeC {\cyrs }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyrc }\IeC {\cyrery } \IeC {\cyro }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrs }\IeC {\cyro }\IeC {\cyrv }\IeC {\cyrk }\IeC {\cyri }}{12}{appendix.B}%
|
||||||
\contentsline {section}{\numberline {\CYRV }\IeC {\CYRM }\IeC {\cyrn }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyrch }\IeC {\cyrn }\IeC {\cyra }\IeC {\cyrya } \IeC {\cyrt }\IeC {\cyra }\IeC {\cyrb }\IeC {\cyrl }\IeC {\cyri }\IeC {\cyrc }\IeC {\cyra }}{19}{appendix.C}%
|
\contentsline {section}{\numberline {\CYRV }\IeC {\CYRK }\IeC {\cyro }\IeC {\cyrd } \IeC {\cyro }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyri }\IeC {\cyrs }\IeC {\cyro }\IeC {\cyrv }\IeC {\cyrk }\IeC {\cyri } \IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrf }\IeC {\cyra }}{23}{appendix.C}%
|
||||||
|
\contentsline {section}{\numberline {\CYRG }\IeC {\CYRK }\IeC {\cyro }\IeC {\cyrd } \IeC {\cyrk }\IeC {\cyrl }\IeC {\cyra }\IeC {\cyrs }\IeC {\cyrs }\IeC {\cyra } \IeC {\cyrd }\IeC {\cyrl }\IeC {\cyrya } \IeC {\cyrr }\IeC {\cyra }\IeC {\cyrb }\IeC {\cyro }\IeC {\cyrt }\IeC {\cyrery } \IeC {\cyrs } \IeC {\cyrg }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrf }\IeC {\cyro }\IeC {\cyrm }}{30}{appendix.D}%
|
||||||
\contentsfinish
|
\contentsfinish
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
import 'package:graphs/pages/drawing_page.dart';
|
||||||
|
import 'package:desktop_window/desktop_window.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
runApp(const MyApp());
|
||||||
|
}
|
||||||
|
|
||||||
|
Future setupWindow() async {
|
||||||
|
await DesktopWindow.setMinWindowSize(const Size(850, 700));
|
||||||
|
}
|
||||||
|
|
||||||
|
class MyApp extends StatelessWidget {
|
||||||
|
const MyApp({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
setupWindow();
|
||||||
|
return const MaterialApp(
|
||||||
|
title: "Graphs",
|
||||||
|
home: DrawingPage(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,509 @@
|
||||||
|
import 'package:graphs/src/graph.dart';
|
||||||
|
import 'package:graphs/src/curve_painter.dart';
|
||||||
|
|
||||||
|
import 'package:file_picker/file_picker.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
Graphs getGraph() {
|
||||||
|
List<Dot> d = <Dot>[];
|
||||||
|
d.add(Dot.fromTwoLists("1", [2], [3]));
|
||||||
|
d.add(Dot.fromTwoLists("2", [3], [1]));
|
||||||
|
d.add(Dot.fromTwoLists("3", [1], [2]));
|
||||||
|
return Graphs.fromList("Èìÿ ãðàôà", d, true, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
class DrawingPage extends StatefulWidget {
|
||||||
|
const DrawingPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<StatefulWidget> createState() => _DrawingPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DrawingPageState extends State<DrawingPage> {
|
||||||
|
double screenSize = 0;
|
||||||
|
Graphs graphData = getGraph();
|
||||||
|
List<int?>? intListPath;
|
||||||
|
List<bool>? dfsAccessTable;
|
||||||
|
//List<int?>? dijkstraTable;
|
||||||
|
String op = Operations.none;
|
||||||
|
int? startDot;
|
||||||
|
int? endDot;
|
||||||
|
String? dropdownValue1;
|
||||||
|
String? dropdownValue2;
|
||||||
|
String currOp = "";
|
||||||
|
|
||||||
|
final _textNameController = TextEditingController();
|
||||||
|
final _textLnthController = TextEditingController();
|
||||||
|
final _textGrNmController = TextEditingController();
|
||||||
|
|
||||||
|
void clearInputData() {
|
||||||
|
setState(() {
|
||||||
|
_textLnthController.clear();
|
||||||
|
_textNameController.clear();
|
||||||
|
dropdownValue1 = null;
|
||||||
|
dropdownValue2 = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void clearDropDownVals() {
|
||||||
|
setState(() {
|
||||||
|
startDot = null;
|
||||||
|
intListPath = null;
|
||||||
|
dfsAccessTable = null;
|
||||||
|
endDot = null;
|
||||||
|
currOp = "";
|
||||||
|
op = Operations.none;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// *************buttons*************
|
||||||
|
ElevatedButton createButton(String txt, void Function() onPressing) {
|
||||||
|
return ElevatedButton(
|
||||||
|
onPressed: onPressing,
|
||||||
|
style: ButtonStyle(
|
||||||
|
backgroundColor: MaterialStateProperty.resolveWith<Color>(
|
||||||
|
(states) => Colors.green.shade700)),
|
||||||
|
child: Text(txt,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
color: Colors.white70,
|
||||||
|
height: 1,
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void showPopUp(String alertTitle, String err) => showDialog<String>(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) => AlertDialog(
|
||||||
|
title: Text(alertTitle, style: const TextStyle(fontSize: 26)),
|
||||||
|
content: Text(
|
||||||
|
err,
|
||||||
|
style: const TextStyle(fontSize: 18),
|
||||||
|
),
|
||||||
|
actions: <Widget>[
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(context, 'OK'),
|
||||||
|
child: const Text('OK'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
// *************buttons*************
|
||||||
|
|
||||||
|
// ***addSpace***
|
||||||
|
SizedBox addSpaceH(double h) {
|
||||||
|
return SizedBox(height: h);
|
||||||
|
}
|
||||||
|
|
||||||
|
SizedBox addSpaceW(double w) {
|
||||||
|
return SizedBox(width: w);
|
||||||
|
}
|
||||||
|
// ***addSpace***
|
||||||
|
|
||||||
|
// *************inputs*************
|
||||||
|
Container createInputBox(String text, double width, IconData? icon,
|
||||||
|
TextEditingController? controller) {
|
||||||
|
if (icon == null) {
|
||||||
|
return Container(
|
||||||
|
width: width,
|
||||||
|
height: 40,
|
||||||
|
margin: const EdgeInsets.symmetric(horizontal: 20, vertical: 5),
|
||||||
|
child: TextField(
|
||||||
|
controller: controller,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
onChanged: (name) => graphData.setName(name),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
|
||||||
|
filled: true,
|
||||||
|
fillColor: Colors.white,
|
||||||
|
//prefixIcon: Icon(icon, color: Colors.black),
|
||||||
|
border: const OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(40))),
|
||||||
|
hintStyle: const TextStyle(color: Colors.black38),
|
||||||
|
hintText: text),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
return Container(
|
||||||
|
width: width,
|
||||||
|
height: 40,
|
||||||
|
margin: const EdgeInsets.symmetric(horizontal: 20, vertical: 5),
|
||||||
|
child: TextField(
|
||||||
|
controller: controller,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
|
||||||
|
filled: true,
|
||||||
|
fillColor: Colors.white,
|
||||||
|
prefixIcon: Icon(icon, color: Colors.black),
|
||||||
|
border: const OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(40))),
|
||||||
|
hintStyle: const TextStyle(color: Colors.black38),
|
||||||
|
hintText: text),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
SizedBox dropList1(double width) {
|
||||||
|
var button = DropdownButton(
|
||||||
|
hint: const Text(
|
||||||
|
'Select dot',
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 13),
|
||||||
|
),
|
||||||
|
alignment: AlignmentDirectional.bottomEnd,
|
||||||
|
value: dropdownValue1,
|
||||||
|
isDense: true,
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
||||||
|
dropdownColor: Colors.green.shade800,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 18,
|
||||||
|
),
|
||||||
|
onChanged: (String? newValue) {
|
||||||
|
setState(() {
|
||||||
|
dropdownValue1 = newValue;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
items: graphData.getDots().map((location) {
|
||||||
|
return DropdownMenuItem(
|
||||||
|
child: Text(location.getName()),
|
||||||
|
value: location.num.toString(),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
);
|
||||||
|
|
||||||
|
return SizedBox(
|
||||||
|
child: button,
|
||||||
|
width: width,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
SizedBox dropList2(double width) {
|
||||||
|
var button = DropdownButton(
|
||||||
|
hint: const Text(
|
||||||
|
'Select Dot',
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 13),
|
||||||
|
),
|
||||||
|
alignment: AlignmentDirectional.centerEnd,
|
||||||
|
value: dropdownValue2,
|
||||||
|
isDense: true,
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
||||||
|
dropdownColor: Colors.green.shade800,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 18,
|
||||||
|
),
|
||||||
|
onChanged: (String? newValue) {
|
||||||
|
setState(() {
|
||||||
|
dropdownValue2 = newValue;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
items: graphData.getDots().map((location) {
|
||||||
|
return DropdownMenuItem(
|
||||||
|
child: Text(location.getName()),
|
||||||
|
value: location.num.toString(),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
);
|
||||||
|
|
||||||
|
return SizedBox(
|
||||||
|
child: button,
|
||||||
|
width: width,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// *************inputs*************
|
||||||
|
|
||||||
|
//*********ButtonsFunctions*********
|
||||||
|
void addDotPushed() {
|
||||||
|
clearDropDownVals();
|
||||||
|
if (_textNameController.text == "") {
|
||||||
|
showPopUp("Error", "No name in \"Dot name\" box");
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
String? res = graphData.addIsolated(_textNameController.text);
|
||||||
|
if (res != null) {
|
||||||
|
showPopUp("Error", res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
clearInputData();
|
||||||
|
}
|
||||||
|
|
||||||
|
void addPathPushed() {
|
||||||
|
clearDropDownVals();
|
||||||
|
if (dropdownValue1 == null) {
|
||||||
|
showPopUp("Error", "No dot in first box selected");
|
||||||
|
} else if (dropdownValue2 == null) {
|
||||||
|
showPopUp("Error", "No dot in second box selected");
|
||||||
|
} else if (_textLnthController.text == "" && graphData.getUseLengthBool()) {
|
||||||
|
showPopUp("Error", "No length in \"Input length\" box");
|
||||||
|
} else {
|
||||||
|
int? from = int.parse(dropdownValue1!);
|
||||||
|
int? to = int.parse(dropdownValue2!);
|
||||||
|
int? len = int.tryParse(_textLnthController.text);
|
||||||
|
if (len == null && graphData.getUseLengthBool()) {
|
||||||
|
showPopUp("Error",
|
||||||
|
"Can't parse input.\nInts only allowed in \"Input length\"");
|
||||||
|
} else {
|
||||||
|
len ??= 0;
|
||||||
|
setState(() {
|
||||||
|
String? res = graphData.addPath(from, to, len!);
|
||||||
|
if (res != null) showPopUp("Error", res);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clearInputData();
|
||||||
|
}
|
||||||
|
|
||||||
|
void changeOriented() {
|
||||||
|
setState(() {
|
||||||
|
String? res = graphData.flipUseOrientation();
|
||||||
|
if (res != null) showPopUp("Error", res);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void changeLength() {
|
||||||
|
setState(() {
|
||||||
|
String? res = graphData.flipUseLength();
|
||||||
|
if (res != null) showPopUp("Error", res);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void delPathPushed() {
|
||||||
|
clearDropDownVals();
|
||||||
|
if (dropdownValue1 == null) {
|
||||||
|
showPopUp("Error", "No dot in first box selected");
|
||||||
|
} else if (dropdownValue2 == null) {
|
||||||
|
showPopUp("Error", "No dot in second box selected");
|
||||||
|
} else {
|
||||||
|
int? from = int.tryParse(dropdownValue1!);
|
||||||
|
int? to = int.tryParse(dropdownValue2!);
|
||||||
|
if (from == null || to == null) {
|
||||||
|
showPopUp("Error",
|
||||||
|
"Can't parse input.\nInts only allowed in \"Dot number\" and \"Destination number\"");
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
String? res = graphData.delPath(from, to);
|
||||||
|
if (res != null) {
|
||||||
|
showPopUp("Error", res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clearInputData();
|
||||||
|
}
|
||||||
|
|
||||||
|
void delDotPushed() {
|
||||||
|
if (dropdownValue1 != null) {
|
||||||
|
setState(() {
|
||||||
|
String? res = graphData.delDot(int.parse(dropdownValue1!));
|
||||||
|
if (res != null) {
|
||||||
|
showPopUp("Error", res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
showPopUp("Error", "Nothing in input");
|
||||||
|
}
|
||||||
|
clearDropDownVals();
|
||||||
|
clearInputData();
|
||||||
|
}
|
||||||
|
|
||||||
|
void fileOpener() async {
|
||||||
|
FilePickerResult? result =
|
||||||
|
await FilePicker.platform.pickFiles(allowedExtensions: ["txt"]);
|
||||||
|
|
||||||
|
if (result != null) {
|
||||||
|
if (!result.files.single.path!.endsWith(".txt")) {
|
||||||
|
showPopUp("Error", "Can open only \".txt\" files");
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
String? res =
|
||||||
|
graphData.replaceDataFromFile(result.files.single.path!);
|
||||||
|
|
||||||
|
if (res != null) showPopUp("Error", res);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showPopUp("Error", "No file selected");
|
||||||
|
}
|
||||||
|
clearDropDownVals();
|
||||||
|
clearInputData();
|
||||||
|
}
|
||||||
|
|
||||||
|
void fileSaver() async {
|
||||||
|
String? outputFile = await FilePicker.platform.saveFile(
|
||||||
|
dialogTitle: 'Please select an output file:',
|
||||||
|
fileName: 'output-file.txt',
|
||||||
|
allowedExtensions: ["txt"]);
|
||||||
|
if (outputFile == null) {
|
||||||
|
showPopUp("Error", "Save cancelled");
|
||||||
|
} else {
|
||||||
|
if (!outputFile.endsWith(".txt")) {
|
||||||
|
outputFile += ".txt";
|
||||||
|
}
|
||||||
|
graphData.printToFile(outputFile);
|
||||||
|
}
|
||||||
|
clearDropDownVals();
|
||||||
|
clearInputData();
|
||||||
|
}
|
||||||
|
|
||||||
|
void bfsPushed() {
|
||||||
|
clearDropDownVals();
|
||||||
|
if (dropdownValue1 == null) {
|
||||||
|
showPopUp("Error", "No dot in first box selected");
|
||||||
|
} else if (dropdownValue2 == null) {
|
||||||
|
showPopUp("Error", "No dot in second box selected");
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
startDot = int.parse(dropdownValue1!);
|
||||||
|
endDot = int.parse(dropdownValue2!);
|
||||||
|
currOp = "OP: BFS from $startDot to $endDot";
|
||||||
|
op = Operations.bfs;
|
||||||
|
intListPath = graphData.bfsPath(startDot!, endDot!);
|
||||||
|
});
|
||||||
|
if (intListPath == null) {
|
||||||
|
showPopUp("Info", "There is no path");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clearInputData();
|
||||||
|
}
|
||||||
|
|
||||||
|
void dfsPushed() {
|
||||||
|
clearDropDownVals();
|
||||||
|
if (dropdownValue1 == null) {
|
||||||
|
showPopUp("Error", "No dot in first box selected");
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
startDot = int.parse(dropdownValue1!);
|
||||||
|
op = Operations.dfs;
|
||||||
|
currOp = "OP: DFS from $startDot";
|
||||||
|
dfsAccessTable = graphData.dfsIterative(startDot!);
|
||||||
|
});
|
||||||
|
if (dfsAccessTable == null) {
|
||||||
|
showPopUp("Err", "report this error.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
clearInputData();
|
||||||
|
}
|
||||||
|
|
||||||
|
void dijkstraPushed() {
|
||||||
|
clearDropDownVals();
|
||||||
|
if (dropdownValue1 == null) {
|
||||||
|
showPopUp("Error", "No number in \"Dot number\" box");
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
startDot = int.parse(dropdownValue1!);
|
||||||
|
currOp = "OP: Dijkstra from $startDot";
|
||||||
|
op = Operations.dijkstra;
|
||||||
|
intListPath = graphData.dijkstra(startDot!);
|
||||||
|
});
|
||||||
|
if (intListPath == null) {
|
||||||
|
showPopUp("Err", "report this error.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clearInputData();
|
||||||
|
}
|
||||||
|
//*********ButtonsFunctions*********
|
||||||
|
|
||||||
|
// build
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
screenSize = MediaQuery.of(context).size.width;
|
||||||
|
_textGrNmController.text = graphData.getName();
|
||||||
|
return MaterialApp(
|
||||||
|
home: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Align(
|
||||||
|
alignment: Alignment.topLeft,
|
||||||
|
child: Text("Graph name:\n",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18,
|
||||||
|
color: Colors.white,
|
||||||
|
))),
|
||||||
|
toolbarHeight: 110,
|
||||||
|
flexibleSpace: Container(
|
||||||
|
color: Colors.green.shade900,
|
||||||
|
child: Column(children: <Widget>[
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
Row(children: [
|
||||||
|
addSpaceW(screenSize / 8 + 19),
|
||||||
|
createButton("\nAdd dot\n", addDotPushed),
|
||||||
|
createInputBox("Dot name", screenSize / 4 - 25, Icons.label,
|
||||||
|
_textNameController),
|
||||||
|
addSpaceW(8),
|
||||||
|
createButton("\nAdd path\n", addPathPushed),
|
||||||
|
createInputBox("Input length", screenSize / 4 - 25,
|
||||||
|
Icons.arrow_right_alt_outlined, _textLnthController),
|
||||||
|
]),
|
||||||
|
addSpaceH(3),
|
||||||
|
Row(children: [
|
||||||
|
addSpaceW(6),
|
||||||
|
createInputBox(
|
||||||
|
"Name", screenSize / 8 - 25, null, _textGrNmController),
|
||||||
|
createButton("\nDel dot \n", delDotPushed),
|
||||||
|
addSpaceW(54),
|
||||||
|
dropList1(screenSize / 4 - 80),
|
||||||
|
addSpaceW(53),
|
||||||
|
createButton("\nDel path\n", delPathPushed),
|
||||||
|
addSpaceW(54),
|
||||||
|
dropList2(screenSize / 4 - 80),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
clearDropDownVals();
|
||||||
|
graphData.flushData();
|
||||||
|
clearInputData();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.delete_sweep),
|
||||||
|
iconSize: 60,
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
body: CustomPaint(
|
||||||
|
painter: CurvePainter(
|
||||||
|
graphData: graphData,
|
||||||
|
intListPath: intListPath,
|
||||||
|
dfsAccessTable: dfsAccessTable,
|
||||||
|
start: startDot,
|
||||||
|
end: endDot,
|
||||||
|
op: op),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.topRight,
|
||||||
|
child: ButtonBar(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
currOp,
|
||||||
|
style: const TextStyle(fontSize: 14, color: Colors.black),
|
||||||
|
),
|
||||||
|
createButton("Bfs", bfsPushed),
|
||||||
|
createButton("Dfs", dfsPushed),
|
||||||
|
createButton("Dijkstra", dijkstraPushed),
|
||||||
|
createButton("Kruskal", () {
|
||||||
|
clearDropDownVals();
|
||||||
|
setState(() {
|
||||||
|
currOp = "OP: Kruscal algo";
|
||||||
|
graphData.kruskal();
|
||||||
|
});
|
||||||
|
clearInputData();
|
||||||
|
}),
|
||||||
|
createButton("Clear OP", () {
|
||||||
|
clearDropDownVals();
|
||||||
|
clearInputData();
|
||||||
|
}),
|
||||||
|
createButton(graphData.getUseLengthStr(), changeLength),
|
||||||
|
createButton(graphData.getDoubleSidedStr(), changeOriented),
|
||||||
|
createButton("Save to file", fileSaver),
|
||||||
|
createButton("Load from file", fileOpener),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,328 @@
|
||||||
|
import 'package:arrow_path/arrow_path.dart';
|
||||||
|
import 'package:graphs/src/graph.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'dart:math';
|
||||||
|
|
||||||
|
class Operations {
|
||||||
|
static const String bfs = "bfs";
|
||||||
|
static const String dfs = "dfs";
|
||||||
|
static const String dijkstra = "djkstr";
|
||||||
|
static const String none = "none";
|
||||||
|
}
|
||||||
|
|
||||||
|
class CurvePainter extends CustomPainter {
|
||||||
|
CurvePainter({
|
||||||
|
Key? key,
|
||||||
|
required this.graphData,
|
||||||
|
required this.intListPath,
|
||||||
|
required this.dfsAccessTable,
|
||||||
|
required this.start,
|
||||||
|
required this.end,
|
||||||
|
required this.op,
|
||||||
|
});
|
||||||
|
|
||||||
|
List<int?>? intListPath;
|
||||||
|
List<bool>? dfsAccessTable;
|
||||||
|
String op;
|
||||||
|
int? start;
|
||||||
|
int? end;
|
||||||
|
Graphs graphData;
|
||||||
|
final double _dotRad = 7;
|
||||||
|
final double _lineWidth = 1.5;
|
||||||
|
final Color _lineColor = Colors.black;
|
||||||
|
final double _aboveHeight = 5;
|
||||||
|
double _circleRad = 100;
|
||||||
|
final TextStyle _textStyle = TextStyle(
|
||||||
|
color: Colors.red.shade900,
|
||||||
|
decorationColor: Colors.green.shade900,
|
||||||
|
decorationThickness: 10,
|
||||||
|
decorationStyle: TextDecorationStyle.dashed,
|
||||||
|
fontSize: 20,
|
||||||
|
);
|
||||||
|
Map<int, Offset> _off = <int, Offset>{};
|
||||||
|
void _drawLine(Canvas canvas, Offset p1, Offset p2) {
|
||||||
|
Paint p = Paint();
|
||||||
|
p.color = _lineColor;
|
||||||
|
p.strokeWidth = _lineWidth;
|
||||||
|
canvas.drawLine(p1, p2, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _drawDot(Canvas canvas, Offset p1, [double plusRad = 0, Color? col]) {
|
||||||
|
col ??= Colors.yellow.shade900;
|
||||||
|
var p = Paint();
|
||||||
|
p.color = col;
|
||||||
|
p.strokeWidth = _lineWidth + 2;
|
||||||
|
canvas.drawCircle(p1, _dotRad + plusRad, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _drawSelfConnect(Canvas canvas, Offset p1) {
|
||||||
|
var p = Paint();
|
||||||
|
p.color = _lineColor;
|
||||||
|
p.strokeWidth = _lineWidth;
|
||||||
|
p.style = PaintingStyle.stroke;
|
||||||
|
canvas.drawCircle(Offset(p1.dx + _dotRad + 20, p1.dy), _dotRad + 20, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
TextSpan _getTextSpan(String s) => TextSpan(text: s, style: _textStyle);
|
||||||
|
TextPainter _getTextPainter(String s) => TextPainter(
|
||||||
|
text: _getTextSpan(s),
|
||||||
|
textDirection: TextDirection.ltr,
|
||||||
|
textAlign: TextAlign.center);
|
||||||
|
|
||||||
|
void _drawDotNames(Canvas canvas, Offset place, String s) {
|
||||||
|
var textPainter = _getTextPainter(s);
|
||||||
|
textPainter.layout();
|
||||||
|
textPainter.paint(
|
||||||
|
canvas,
|
||||||
|
Offset((place.dx - textPainter.width),
|
||||||
|
(place.dy - textPainter.height) - _aboveHeight));
|
||||||
|
}
|
||||||
|
|
||||||
|
void _drawDotNum(Canvas canvas, Offset size, String s) {
|
||||||
|
var textPainter = TextPainter(
|
||||||
|
text: TextSpan(
|
||||||
|
text: s,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
fontSize: 17,
|
||||||
|
)),
|
||||||
|
textDirection: TextDirection.ltr,
|
||||||
|
textAlign: TextAlign.center);
|
||||||
|
textPainter.layout();
|
||||||
|
textPainter.paint(
|
||||||
|
canvas,
|
||||||
|
Offset((size.dx - textPainter.width) + 25,
|
||||||
|
(size.dy - textPainter.height) + _aboveHeight + 30));
|
||||||
|
}
|
||||||
|
|
||||||
|
int _getHighInputConnections() {
|
||||||
|
if (graphData.getDots().length != 1 && graphData.getDots().length <= 3) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
int higest = -1;
|
||||||
|
for (var i in graphData.getDots()) {
|
||||||
|
if (i.getL().length > higest) higest = i.num;
|
||||||
|
}
|
||||||
|
return higest;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<int, Offset> _getDotPos(int dotsAm, Size size) {
|
||||||
|
Map<int, Offset> off = <int, Offset>{};
|
||||||
|
var width = size.width / 2;
|
||||||
|
var height = size.height / 2;
|
||||||
|
int add = 0;
|
||||||
|
int h = _getHighInputConnections();
|
||||||
|
for (int i = 0; i < dotsAm; i++) {
|
||||||
|
if ((i + 1) != h) {
|
||||||
|
double x =
|
||||||
|
cos(2 * pi * (i - add) / (dotsAm - add)) * _circleRad + width;
|
||||||
|
double y =
|
||||||
|
sin(2 * pi * (i - add) / (dotsAm - add)) * _circleRad + height;
|
||||||
|
|
||||||
|
off[i + 1] = Offset(x, y);
|
||||||
|
} else if ((i + 1) == h) {
|
||||||
|
off[i + 1] = Offset(width + 2, height - 2);
|
||||||
|
add = 1;
|
||||||
|
h = 0;
|
||||||
|
} else {
|
||||||
|
print("GetDotPos error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return off;
|
||||||
|
}
|
||||||
|
|
||||||
|
void _drawHArrow(Canvas canvas, Size size, Offset from, Offset to,
|
||||||
|
[bool doubleSided = false]) {
|
||||||
|
Path path;
|
||||||
|
|
||||||
|
// The arrows usually looks better with rounded caps.
|
||||||
|
Paint paint = Paint()
|
||||||
|
..color = Colors.black
|
||||||
|
..style = PaintingStyle.stroke
|
||||||
|
..strokeCap = StrokeCap.round
|
||||||
|
..strokeJoin = StrokeJoin.round
|
||||||
|
..strokeWidth = _lineWidth;
|
||||||
|
|
||||||
|
var length = sqrt((to.dx - from.dx) * (to.dx - from.dx) +
|
||||||
|
(to.dy - from.dy) * (to.dy - from.dy));
|
||||||
|
|
||||||
|
/// Draw a single arrow.
|
||||||
|
path = Path();
|
||||||
|
path.moveTo(from.dx, from.dy);
|
||||||
|
path.relativeCubicTo(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
-(from.dx + to.dx + length) / (length) - 40,
|
||||||
|
-(from.dy + to.dy + length) / (length) - 40,
|
||||||
|
to.dx - from.dx,
|
||||||
|
to.dy - from.dy);
|
||||||
|
path =
|
||||||
|
ArrowPath.make(path: path, isDoubleSided: doubleSided, tipLength: 16);
|
||||||
|
canvas.drawPath(path, paint);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _drawHighArrow(Canvas canvas, Size size, Offset from, Offset to,
|
||||||
|
[bool doubleSided = false]) {
|
||||||
|
Path path;
|
||||||
|
|
||||||
|
Paint paint = Paint()
|
||||||
|
..color = Colors.black
|
||||||
|
..style = PaintingStyle.stroke
|
||||||
|
..strokeCap = StrokeCap.round
|
||||||
|
..strokeJoin = StrokeJoin.round
|
||||||
|
..strokeWidth = _lineWidth;
|
||||||
|
|
||||||
|
var length = sqrt((to.dx - from.dx) * (to.dx - from.dx) +
|
||||||
|
(to.dy - from.dy) * (to.dy - from.dy));
|
||||||
|
|
||||||
|
/// Draw a single arrow.
|
||||||
|
path = Path();
|
||||||
|
path.moveTo(from.dx, from.dy);
|
||||||
|
path.relativeCubicTo(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
(from.dx + to.dx) / (length * 2) + 40,
|
||||||
|
(from.dy + to.dy) / (length * 2) + 40,
|
||||||
|
to.dx - from.dx,
|
||||||
|
to.dy - from.dy);
|
||||||
|
path = ArrowPath.make(
|
||||||
|
path: path,
|
||||||
|
isDoubleSided: doubleSided,
|
||||||
|
tipLength: 13,
|
||||||
|
isAdjusted: false);
|
||||||
|
canvas.drawPath(path, paint);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _drawConnections(
|
||||||
|
Canvas canvas, Size size, List<Dot> dots, Map<int, Offset> off) {
|
||||||
|
for (var i in dots) {
|
||||||
|
var list = i.getL();
|
||||||
|
var beg = off[i.num];
|
||||||
|
for (var d in list.keys) {
|
||||||
|
if (d == i.num) {
|
||||||
|
_drawSelfConnect(canvas, off[d]!);
|
||||||
|
} else {
|
||||||
|
if (graphData.getDoubleSidedBool()) {
|
||||||
|
if (d > i.num) {
|
||||||
|
_drawHArrow(canvas, size, beg!, off[d]!, false);
|
||||||
|
if (graphData.getUseLengthBool()) {
|
||||||
|
_drawDotNames(
|
||||||
|
canvas,
|
||||||
|
Offset((off[d]!.dx + beg.dx) / 2 - 18,
|
||||||
|
(off[d]!.dy + beg.dy) / 2 - 18),
|
||||||
|
i.getL()[d].toString());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
_drawHighArrow(canvas, size, beg!, off[d]!, false);
|
||||||
|
if (graphData.getUseLengthBool()) {
|
||||||
|
_drawDotNames(
|
||||||
|
canvas,
|
||||||
|
Offset((off[d]!.dx + beg.dx) / 2 + 30,
|
||||||
|
(off[d]!.dy + beg.dy) / 2 + 30),
|
||||||
|
i.getL()[d].toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
_drawLine(canvas, beg!, off[d]!);
|
||||||
|
if (graphData.getUseLengthBool()) {
|
||||||
|
_drawDotNames(
|
||||||
|
canvas,
|
||||||
|
Offset((off[d]!.dx + beg.dx) / 2, (off[d]!.dy + beg.dy) / 2),
|
||||||
|
i.getL()[d].toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _drawBFS(Canvas canvas) {
|
||||||
|
if (intListPath != null) {
|
||||||
|
for (int i = 0; i < intListPath!.length; i++) {
|
||||||
|
_drawDot(canvas, _off[intListPath![i]]!, 8, Colors.yellow);
|
||||||
|
}
|
||||||
|
_drawDot(canvas, _off[start]!, 9, Colors.green);
|
||||||
|
_drawDot(canvas, _off[end]!, 7, Colors.red.shade200);
|
||||||
|
for (int i = 0; i < intListPath!.length; i++) {
|
||||||
|
_drawDotNum(canvas, _off[intListPath![i]]!, "bfs: ¹${i + 1}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _drawDFS(Canvas canvas) {
|
||||||
|
if (dfsAccessTable != null) {
|
||||||
|
for (int i = 0; i < dfsAccessTable!.length; i++) {
|
||||||
|
if (dfsAccessTable![i]) {
|
||||||
|
_drawDot(canvas, _off[i + 1]!, 8, Colors.green.shade500);
|
||||||
|
_drawDotNum(canvas, _off[i + 1]!, "dfs: visible");
|
||||||
|
} else {
|
||||||
|
_drawDot(canvas, _off[i + 1]!, 7, Colors.red.shade500);
|
||||||
|
_drawDotNum(canvas, _off[i + 1]!, "dfs: not visible");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_drawDot(canvas, _off[start]!, 9, Colors.green.shade900);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _drawDijkstra(Canvas canvas) {
|
||||||
|
if (intListPath != null) {
|
||||||
|
_drawDot(canvas, _off[start]!, 9, Colors.green);
|
||||||
|
for (int i = 0; i < intListPath!.length; i++) {
|
||||||
|
if (intListPath![i] == null) {
|
||||||
|
_drawDotNum(canvas, _off[i + 1]!, "len: INF");
|
||||||
|
} else {
|
||||||
|
_drawDotNum(canvas, _off[i + 1]!, "len: ${intListPath![i]}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void paint(Canvas canvas, Size size) {
|
||||||
|
if (size.width > size.height) {
|
||||||
|
_circleRad = size.height / 3;
|
||||||
|
} else {
|
||||||
|
_circleRad = size.width / 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
_off = _getDotPos(graphData.getDotAmount(), size); //, higest);
|
||||||
|
for (int i in _off.keys) {
|
||||||
|
_drawDot(canvas, _off[i]!);
|
||||||
|
}
|
||||||
|
|
||||||
|
var g = graphData.getDots();
|
||||||
|
switch (op) {
|
||||||
|
case Operations.bfs:
|
||||||
|
{
|
||||||
|
_drawBFS(canvas);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Operations.dfs:
|
||||||
|
{
|
||||||
|
_drawDFS(canvas);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Operations.dijkstra:
|
||||||
|
{
|
||||||
|
_drawDijkstra(canvas);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_drawConnections(canvas, size, g, _off);
|
||||||
|
for (int i in _off.keys) {
|
||||||
|
_drawDotNames(
|
||||||
|
canvas, _off[i]!, "${graphData.getDots()[i - 1].getName()}:[$i]");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool shouldRepaint(CustomPainter oldDelegate) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,696 @@
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
class Separators {
|
||||||
|
static const String dotToConnections = ": ";
|
||||||
|
static const String dotToLength = "|";
|
||||||
|
static const String space = " ";
|
||||||
|
static const String hasLength = "Âçâåøåííûé";
|
||||||
|
static const String hasNoLength = "ÍåÂçâåøåííûé";
|
||||||
|
static const String isOriented = "Îðèåíòèðîâàííûé";
|
||||||
|
static const String isNotOriented = "ÍåÎðèåíòèðîâàííûé";
|
||||||
|
static const String nL = "\n";
|
||||||
|
static const String end = "END";
|
||||||
|
|
||||||
|
Separators();
|
||||||
|
}
|
||||||
|
|
||||||
|
class Dot {
|
||||||
|
//Data
|
||||||
|
// ignore: prefer_final_fields
|
||||||
|
String _name = "";
|
||||||
|
int num = -1;
|
||||||
|
Map<int, int> _ln = <int, int>{};
|
||||||
|
|
||||||
|
//****Get****
|
||||||
|
String getName() => _name;
|
||||||
|
bool hasConnection(int n) => _ln.containsKey(n);
|
||||||
|
Map<int, int> getL() => _ln;
|
||||||
|
|
||||||
|
int getLength(int x) {
|
||||||
|
if (hasConnection(x)) {
|
||||||
|
return _ln[x]!;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
//****Get****
|
||||||
|
|
||||||
|
//Set
|
||||||
|
void setName(String n) => _name = n;
|
||||||
|
|
||||||
|
//Add
|
||||||
|
void addPath(int inp, int length) => _ln[inp] = length;
|
||||||
|
|
||||||
|
//Del
|
||||||
|
void delPath(int n) => _ln.removeWhere((key, value) =>
|
||||||
|
key == n); // óäàëèòü îáðàòíûé ïóòü åñëè íå îðèåíòèðîâàííûé
|
||||||
|
|
||||||
|
//Print
|
||||||
|
void printD() {
|
||||||
|
stdout.write("$_name: ¹$num => ");
|
||||||
|
for (var i in _ln.keys) {
|
||||||
|
stdout.write("$i|${_ln[i]} ");
|
||||||
|
}
|
||||||
|
stdout.write("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
//******Constructor******
|
||||||
|
Dot([String name = "Undefined", int n = -1]) {
|
||||||
|
_name = name;
|
||||||
|
num = n;
|
||||||
|
_ln = <int, int>{};
|
||||||
|
}
|
||||||
|
Dot.fromTwoLists(String name, List<int> num0, List<int> length,
|
||||||
|
[int n = -1]) {
|
||||||
|
_name = name;
|
||||||
|
num = n;
|
||||||
|
Map<int, int> nw = <int, int>{};
|
||||||
|
if (num0.length != length.length) {
|
||||||
|
print("Error in lists");
|
||||||
|
} else {
|
||||||
|
for (var i = 0; i < num0.length; i++) {
|
||||||
|
nw[num0[i]] = length[i];
|
||||||
|
_ln = nw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Dot.fromMap(String name, Map<int, int> l, [int n = -1]) {
|
||||||
|
_name = name;
|
||||||
|
num = n;
|
||||||
|
_ln = l;
|
||||||
|
}
|
||||||
|
//******Constructor******
|
||||||
|
|
||||||
|
//Copy
|
||||||
|
Dot.clone(Dot a) {
|
||||||
|
_name = a.getName();
|
||||||
|
num = a.num;
|
||||||
|
_ln = a.getL();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Graphs {
|
||||||
|
static const int intMax = 0x7fffffffffffffff;
|
||||||
|
//Data
|
||||||
|
String _name = "Undefined"; //Èìÿ
|
||||||
|
int _amount = 0; //Êîëè÷åñòâî âåðøèí
|
||||||
|
List<Dot> _dots = <Dot>[]; //Ñïèñîê ñìåæíîñòè âåðøèí
|
||||||
|
Map<int, String> _nameTable = <int, String>{}; //Ñïèñîê âåðøèí ïî èìåíàì
|
||||||
|
bool _useLength = false; //Âçâåøåííîñòü
|
||||||
|
bool _oriented = false; //Îðèåíòèðîâàííîñòü
|
||||||
|
|
||||||
|
//*********************Add************************
|
||||||
|
String? addDot(Dot a) {
|
||||||
|
if (getNumByName(a.getName()) != null) {
|
||||||
|
return ("Dot name \"${a.getName()}\" already in use. Change name or use addPath");
|
||||||
|
}
|
||||||
|
_amount++;
|
||||||
|
a.num = _amount;
|
||||||
|
_dots.add(a);
|
||||||
|
_syncNameTable();
|
||||||
|
checkDots(false);
|
||||||
|
if (!_oriented) _fullFix();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool addDotFromToLists(String name, List<int> num0, List<int> length,
|
||||||
|
[int n = -1]) {
|
||||||
|
var a = Dot.fromTwoLists(name, num0, length, n);
|
||||||
|
if (getNumByName(a.getName()) != null) {
|
||||||
|
print(
|
||||||
|
"Dot name ${a.getName()} already in use. Change name or use addPath");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
_amount++;
|
||||||
|
a.num = _amount;
|
||||||
|
_dots.add(a);
|
||||||
|
_syncNameTable();
|
||||||
|
checkDots(false);
|
||||||
|
if (!_oriented) _fixPathAfterInsert(a);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
String? addIsolated(String name) {
|
||||||
|
var res = addDot(Dot.fromTwoLists(name, [], []));
|
||||||
|
_syncNameTable();
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
String? addPath(int from, int to, [int len = 0]) {
|
||||||
|
if (from <= 0 || from > _amount || to <= 0 && to > _amount) {
|
||||||
|
return "Index out of range. Have dots 1..$_amount";
|
||||||
|
}
|
||||||
|
_dots[from - 1].addPath(to, len);
|
||||||
|
if (!_oriented) {
|
||||||
|
_dots[to - 1].addPath(from, len);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
//*********************Add************************
|
||||||
|
|
||||||
|
//*********Delete*********
|
||||||
|
String? delPath(int from, int to) {
|
||||||
|
if (from <= 0 || from > _amount || to <= 0 && to > _amount) {
|
||||||
|
return "Can't find specified path";
|
||||||
|
}
|
||||||
|
if (!_dots[from - 1].hasConnection(to)) {
|
||||||
|
return "Already no connection between $from and $to";
|
||||||
|
}
|
||||||
|
_dots[from - 1].delPath(to);
|
||||||
|
if (!_oriented) {
|
||||||
|
_dots[to - 1].delPath(from);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String? delDot(int inn) {
|
||||||
|
if (inn > _amount || inn < 1) {
|
||||||
|
return "Index out of range. Allowed 1..$_amount";
|
||||||
|
}
|
||||||
|
List<int> toDel = <int>[];
|
||||||
|
for (int i in _dots[inn - 1].getL().keys) {
|
||||||
|
toDel.add(i);
|
||||||
|
}
|
||||||
|
for (int i in toDel) {
|
||||||
|
delPath(i, inn);
|
||||||
|
}
|
||||||
|
_dots.removeAt(inn - 1);
|
||||||
|
_syncNum();
|
||||||
|
_syncNameTable();
|
||||||
|
_fixAfterDel(inn);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
void flushData() {
|
||||||
|
_dots = <Dot>[];
|
||||||
|
_amount = 0;
|
||||||
|
_nameTable = <int, String>{};
|
||||||
|
}
|
||||||
|
//*********Delete*********
|
||||||
|
|
||||||
|
//******Helper*******
|
||||||
|
bool checkDots([bool verbose = false]) {
|
||||||
|
for (var a in _dots) {
|
||||||
|
for (var i in a.getL().keys) {
|
||||||
|
try {
|
||||||
|
if (!_dots[i - 1].getL().containsKey(a.num)) {
|
||||||
|
if (verbose) print("Can't find ${a.num}");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
if (verbose) {
|
||||||
|
print("Can't find Dot $i for path ${a.num}->$i. Exception $e");
|
||||||
|
}
|
||||||
|
_dots[a.num - 1].getL().remove(i);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void _fixAfterDel(int inn) {
|
||||||
|
for (int i = 0; i < _dots.length; i++) {
|
||||||
|
Map<int, int> l = <int, int>{};
|
||||||
|
for (int j in _dots[i].getL().keys) {
|
||||||
|
if (j >= inn) {
|
||||||
|
l[j - 1] = _dots[i].getL()[j]!;
|
||||||
|
} else {
|
||||||
|
l[j] = _dots[i].getL()[j]!;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_dots[i] = Dot.fromMap(_dots[i].getName(), l, _dots[i].num);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _fixPathAfterInsert(Dot a) {
|
||||||
|
//Äëÿ íåîðèåíòèðîâàííîãî
|
||||||
|
for (var i in a.getL().keys) {
|
||||||
|
if (!_dots[i - 1].getL().containsKey(a.num)) {
|
||||||
|
addPath(i, a.num, a.getL()[i]!);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _fullFix() {
|
||||||
|
for (var i in _dots) {
|
||||||
|
_fixPathAfterInsert(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _syncNameTable() {
|
||||||
|
_nameTable = <int, String>{};
|
||||||
|
for (var i in _dots) {
|
||||||
|
_nameTable[i.num] = i.getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _syncNum() {
|
||||||
|
_amount = 0;
|
||||||
|
for (var i in _dots) {
|
||||||
|
i.num = ++_amount;
|
||||||
|
}
|
||||||
|
_syncNameTable();
|
||||||
|
}
|
||||||
|
//******Helper*******
|
||||||
|
|
||||||
|
//*****Setters*******
|
||||||
|
void setName(String name) => _name = name;
|
||||||
|
String? flipUseOrientation() {
|
||||||
|
if (_amount != 0) {
|
||||||
|
return "Can change use of orientation only in empty graph";
|
||||||
|
}
|
||||||
|
_oriented = !_oriented;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String? flipUseLength() {
|
||||||
|
if (_amount != 0) {
|
||||||
|
return "Can change use of length only in empty graph";
|
||||||
|
}
|
||||||
|
_useLength = !_useLength;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String? replaceDataFromFile(String path) {
|
||||||
|
File file = File(path);
|
||||||
|
List<String> lines = file.readAsLinesSync();
|
||||||
|
if (lines.length < 3) {
|
||||||
|
return "Not enough lines in file";
|
||||||
|
}
|
||||||
|
String name = lines.removeAt(0);
|
||||||
|
bool oriented;
|
||||||
|
switch (lines.removeAt(0)) {
|
||||||
|
case Separators.isOriented:
|
||||||
|
oriented = true;
|
||||||
|
break;
|
||||||
|
case Separators.isNotOriented:
|
||||||
|
oriented = false;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return "Error on parsing \"IsOriented\"";
|
||||||
|
}
|
||||||
|
bool useLength;
|
||||||
|
switch (lines.removeAt(0).trim()) {
|
||||||
|
case Separators.hasLength:
|
||||||
|
useLength = true;
|
||||||
|
break;
|
||||||
|
case Separators.hasNoLength:
|
||||||
|
useLength = false;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return "Error on parsing \"HasLength\"";
|
||||||
|
}
|
||||||
|
List<Dot> dots = <Dot>[];
|
||||||
|
for (var l in lines) {
|
||||||
|
l = l.trimRight();
|
||||||
|
if (l != Separators.end) {
|
||||||
|
var spl = l.split(Separators.space);
|
||||||
|
List<int> dot = <int>[];
|
||||||
|
List<int> len = <int>[];
|
||||||
|
String name = spl.removeAt(0);
|
||||||
|
name = name.substring(0, name.length - 1);
|
||||||
|
for (var splitted in spl) {
|
||||||
|
if (splitted != "") {
|
||||||
|
var dt = splitted.split(Separators.dotToLength);
|
||||||
|
if (dt.length == 2) {
|
||||||
|
int? parsed = int.tryParse(dt[0]);
|
||||||
|
if (parsed == null) {
|
||||||
|
return "Error while parsing file\nin parsing int in \"${dt[0]}\"";
|
||||||
|
}
|
||||||
|
dot.add(parsed);
|
||||||
|
if (useLength) {
|
||||||
|
parsed = int.tryParse(dt[1]);
|
||||||
|
if (parsed == null) {
|
||||||
|
return "Error while parsing file\nin parsing int in \"${dt[1]}\"";
|
||||||
|
}
|
||||||
|
len.add(parsed);
|
||||||
|
} else {
|
||||||
|
len.add(0);
|
||||||
|
}
|
||||||
|
} else if (dt.length == 1) {
|
||||||
|
int? parsed = int.tryParse(splitted);
|
||||||
|
if (parsed == null) {
|
||||||
|
return "Error while parsing file\nin parsing int in \"$splitted\"";
|
||||||
|
}
|
||||||
|
dot.add(parsed);
|
||||||
|
len.add(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dots.add(Dot.fromTwoLists(name, dot, len));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_name = name;
|
||||||
|
_oriented = oriented;
|
||||||
|
_useLength = useLength;
|
||||||
|
_dots = dots;
|
||||||
|
_syncNum();
|
||||||
|
_syncNameTable();
|
||||||
|
if (!_oriented) _fullFix();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
//*****Setters*******
|
||||||
|
|
||||||
|
//*****Getters*******
|
||||||
|
bool getDoubleSidedBool() => _oriented;
|
||||||
|
String getDoubleSidedStr() {
|
||||||
|
if (_oriented) return Separators.isOriented;
|
||||||
|
return Separators.isNotOriented;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool getUseLengthBool() => _useLength;
|
||||||
|
String getUseLengthStr() {
|
||||||
|
if (_useLength) return Separators.hasLength;
|
||||||
|
return Separators.hasNoLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Dot> getDots() => _dots;
|
||||||
|
String getName() => _name;
|
||||||
|
String? getNameByNum(int n) => _nameTable[n];
|
||||||
|
Map<int, String> getNameTable() => _nameTable;
|
||||||
|
int getDotAmount() => _dots.length;
|
||||||
|
int? getNumByName(String n) {
|
||||||
|
for (var i in _nameTable.keys) {
|
||||||
|
if (_nameTable[i] == n) return i;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<List<int>>? getLenTable() {
|
||||||
|
List<List<int>>? out = <List<int>>[];
|
||||||
|
for (int i = 0; i < _amount; i++) {
|
||||||
|
List<int> xx = <int>[];
|
||||||
|
for (int j = 1; j <= _amount; j++) {
|
||||||
|
xx.add(_dots[i].getLength(j));
|
||||||
|
}
|
||||||
|
out.add(xx);
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<List<int>>? getPathTable() {
|
||||||
|
List<List<int>>? out = <List<int>>[];
|
||||||
|
for (int i = 0; i < _amount; i++) {
|
||||||
|
List<int> xx = <int>[];
|
||||||
|
for (int j = 1; j <= _amount; j++) {
|
||||||
|
if (_dots[i].getLength(j) != -1) {
|
||||||
|
xx.add(i);
|
||||||
|
} else {
|
||||||
|
xx.add(-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
out.add(xx);
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<int>? getLongestPath([int start = 1]) {
|
||||||
|
start--;
|
||||||
|
if (start < 0 || start >= _amount) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
int max = -1;
|
||||||
|
int inD = -1;
|
||||||
|
int out = -1;
|
||||||
|
List<int>? res = <int>[];
|
||||||
|
for (int i = start; i < _amount; i++) {
|
||||||
|
var lens = _dots[i].getL();
|
||||||
|
for (var d in lens.keys) {
|
||||||
|
if (lens[d]! > max) {
|
||||||
|
max = lens[d]!;
|
||||||
|
inD = i + 1;
|
||||||
|
out = d;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (inD == -1) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
res.add(inD);
|
||||||
|
res.add(out);
|
||||||
|
res.add(max);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<LenDotPath> getSortedPathList() {
|
||||||
|
int max = -1;
|
||||||
|
int inD = -1;
|
||||||
|
int out = -1;
|
||||||
|
List<LenDotPath> result = <LenDotPath>[];
|
||||||
|
for (int i = 0; i < _amount; i++) {
|
||||||
|
var lens = _dots[i].getL();
|
||||||
|
for (var d in lens.keys) {
|
||||||
|
max = lens[d]!;
|
||||||
|
inD = i + 1;
|
||||||
|
out = d;
|
||||||
|
result.add(LenDotPath(max, inD, out));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.sort((a, b) => a.l.compareTo(b.l));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//*****Getters*******
|
||||||
|
|
||||||
|
//******Print******
|
||||||
|
void printG() {
|
||||||
|
stdout.write("$_name: ");
|
||||||
|
if (_oriented) {
|
||||||
|
stdout.write("Îðèåíòèðîâàííûé, ");
|
||||||
|
} else {
|
||||||
|
stdout.write("Íå îðèåíòèðîâàííûé, ");
|
||||||
|
}
|
||||||
|
if (_useLength) {
|
||||||
|
print("Âçâåøåííûé");
|
||||||
|
} else {
|
||||||
|
print("Íå âçâåøåííûé");
|
||||||
|
}
|
||||||
|
for (var i in _dots) {
|
||||||
|
i.printD();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void printToFile(String name) {
|
||||||
|
var file = File(name);
|
||||||
|
file.writeAsStringSync("$_name\n");
|
||||||
|
if (_oriented) {
|
||||||
|
file.writeAsStringSync("${Separators.isOriented}\n",
|
||||||
|
mode: FileMode.append);
|
||||||
|
} else {
|
||||||
|
file.writeAsStringSync("${Separators.isNotOriented}\n",
|
||||||
|
mode: FileMode.append);
|
||||||
|
}
|
||||||
|
if (_useLength) {
|
||||||
|
file.writeAsStringSync("${Separators.hasLength}\n",
|
||||||
|
mode: FileMode.append);
|
||||||
|
} else {
|
||||||
|
file.writeAsStringSync("${Separators.hasNoLength}\n",
|
||||||
|
mode: FileMode.append);
|
||||||
|
}
|
||||||
|
for (int i = 0; i < _amount; i++) {
|
||||||
|
file.writeAsStringSync(_dots[i].getName() + Separators.dotToConnections,
|
||||||
|
mode: FileMode.append);
|
||||||
|
var d = _dots[i].getL();
|
||||||
|
for (var j in d.keys) {
|
||||||
|
file.writeAsStringSync(
|
||||||
|
j.toString() + Separators.dotToLength + d[j].toString() + " ",
|
||||||
|
mode: FileMode.append);
|
||||||
|
}
|
||||||
|
file.writeAsStringSync(Separators.nL, mode: FileMode.append);
|
||||||
|
}
|
||||||
|
file.writeAsStringSync(Separators.end, mode: FileMode.append);
|
||||||
|
}
|
||||||
|
//******Print******
|
||||||
|
|
||||||
|
//*******Constructor********
|
||||||
|
Graphs(
|
||||||
|
[String name = "Undefined",
|
||||||
|
bool hasLen = false,
|
||||||
|
bool isOriented = false]) {
|
||||||
|
_name = name;
|
||||||
|
_dots = <Dot>[];
|
||||||
|
_useLength = hasLen;
|
||||||
|
_oriented = isOriented;
|
||||||
|
_amount = 0;
|
||||||
|
_nameTable = <int, String>{};
|
||||||
|
}
|
||||||
|
Graphs.fromList(String name, List<Dot> dots, bool hasLen, bool oriented) {
|
||||||
|
_name = name;
|
||||||
|
_dots = dots;
|
||||||
|
_useLength = hasLen;
|
||||||
|
_amount = _dots.length;
|
||||||
|
_oriented = oriented;
|
||||||
|
_syncNum();
|
||||||
|
if (!_oriented) _fullFix();
|
||||||
|
}
|
||||||
|
Graphs.fromFile(String path) {
|
||||||
|
replaceDataFromFile(path);
|
||||||
|
}
|
||||||
|
//*******Constructor********
|
||||||
|
|
||||||
|
//Copy
|
||||||
|
Graphs.clone(Graphs a) {
|
||||||
|
_name = a.getName();
|
||||||
|
_dots = a.getDots();
|
||||||
|
_oriented = a.getDoubleSidedBool();
|
||||||
|
_useLength = a.getUseLengthBool();
|
||||||
|
_amount = _dots.length;
|
||||||
|
_syncNameTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
//************Àëãîðèòìû************
|
||||||
|
List<int>? bfsPath(int startDot, int goalDot) {
|
||||||
|
if (startDot == goalDot) return [startDot];
|
||||||
|
//if (!bfsHasPath(startDot, goalDot)) return null;
|
||||||
|
startDot--;
|
||||||
|
goalDot--;
|
||||||
|
List<List<int>>? graph = getLenTable();
|
||||||
|
List<bool> used = <bool>[];
|
||||||
|
List<int> dst = <int>[];
|
||||||
|
List<int> pr = <int>[];
|
||||||
|
|
||||||
|
for (int i = 0; i < _amount; i++) {
|
||||||
|
dst.add(-1);
|
||||||
|
used.add(false);
|
||||||
|
pr.add(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<int> q = <int>[];
|
||||||
|
q.add(startDot);
|
||||||
|
used[startDot] = true;
|
||||||
|
dst[startDot] = 0;
|
||||||
|
pr[startDot] =
|
||||||
|
-1; //Ïîìåòêà, îçíà÷àþùàÿ, ÷òî ó âåðøèíû startDot íåò ïðåäûäóùåé.
|
||||||
|
|
||||||
|
while (q.isNotEmpty) {
|
||||||
|
int cur = q.removeAt(0);
|
||||||
|
int x = 0;
|
||||||
|
for (int neighbor in graph![cur]) {
|
||||||
|
if (neighbor != -1) {
|
||||||
|
if (!used[x]) {
|
||||||
|
q.add(x);
|
||||||
|
used[x] = true;
|
||||||
|
dst[x] = dst[cur] + 1;
|
||||||
|
pr[x] = cur; //ñîõðàíåíèå ïðåäûäóùåé âåðøèíû
|
||||||
|
}
|
||||||
|
}
|
||||||
|
x++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Âîññòàíîâèì êðàò÷àéøèé ïóòü
|
||||||
|
//Äëÿ âîññòàíîâëåíèÿ ïóòè ïðîéä¸ì åãî â îáðàòíîì ïîðÿäêå, è ðàçâåðí¸ì.
|
||||||
|
List<int> path = <int>[];
|
||||||
|
|
||||||
|
int cur = goalDot; //òåêóùàÿ âåðøèíà ïóòè
|
||||||
|
path.add(cur + 1);
|
||||||
|
|
||||||
|
while (pr[cur] != -1) {
|
||||||
|
//ïîêà ñóùåñòâóåò ïðåäûäóùàÿ âåðøèíà
|
||||||
|
cur = pr[cur]; //ïåðåõîäèì â íå¸
|
||||||
|
path.add(cur + 1); //è äîïèñûâàåì ê ïóòè
|
||||||
|
}
|
||||||
|
|
||||||
|
path = path.reversed.toList();
|
||||||
|
|
||||||
|
if (path[0] == (startDot + 1) &&
|
||||||
|
path[1] == (goalDot + 1) &&
|
||||||
|
!_dots[startDot].hasConnection(goalDot + 1)) return null;
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<bool>? dfsIterative(int v) {
|
||||||
|
v--;
|
||||||
|
List<bool> label = <bool>[];
|
||||||
|
for (int i = 0; i < _amount; i++) {
|
||||||
|
label.add(false);
|
||||||
|
}
|
||||||
|
List<int> stack = <int>[];
|
||||||
|
stack.add(v);
|
||||||
|
//pos.add(v);
|
||||||
|
while (stack.isNotEmpty) {
|
||||||
|
v = stack.removeLast();
|
||||||
|
if (!label[v]) {
|
||||||
|
label[v] = true;
|
||||||
|
for (int i in _dots[v].getL().keys) {
|
||||||
|
stack.add(i - 1);
|
||||||
|
//pos.add(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<int?> dijkstra(int from) {
|
||||||
|
List<int?> d = List<int?>.filled(_amount, intMax);
|
||||||
|
List<int> p = List<int>.filled(_amount, -1);
|
||||||
|
|
||||||
|
d[from - 1] = 0;
|
||||||
|
List<bool> u = List<bool>.filled(_amount, false);
|
||||||
|
for (int i = 0; i < _amount; ++i) {
|
||||||
|
int v = -1;
|
||||||
|
for (int j = 0; j < _amount; ++j) {
|
||||||
|
// int t;
|
||||||
|
if (!u[j] && (v == -1 || d[j]! < d[v]!)) {
|
||||||
|
v = j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (d[v] == intMax) break;
|
||||||
|
u[v] = true;
|
||||||
|
for (int to in _dots[v].getL().keys) {
|
||||||
|
int len = _dots[v].getL()[to]!;
|
||||||
|
if (!_useLength && len == 0) len = 1;
|
||||||
|
if (d[v]! + len < d[to - 1]!) {
|
||||||
|
d[to - 1] = d[v]! + len;
|
||||||
|
p[to - 1] = v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < d.length; i++) {
|
||||||
|
// ïîäóìàòü êàê óáðàòü ýòó ÷àñòü
|
||||||
|
if (d[i] == intMax) d[i] = null;
|
||||||
|
}
|
||||||
|
return d;
|
||||||
|
}
|
||||||
|
|
||||||
|
Graphs? kruskal() {
|
||||||
|
List<LenDotPath> g = getSortedPathList();
|
||||||
|
//int cost = 0;
|
||||||
|
List<Dot> res = <Dot>[];
|
||||||
|
for (int i = 0; i < _amount; i++) {
|
||||||
|
res.add(Dot(_dots[i].getName(), _dots[i].num));
|
||||||
|
}
|
||||||
|
List<int> treeId = List<int>.filled(_amount, 0);
|
||||||
|
for (int i = 0; i < _amount; ++i) {
|
||||||
|
treeId[i] = i;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < g.length; ++i) {
|
||||||
|
int a = g[i].d - 1, b = g[i].p - 1;
|
||||||
|
int l = g[i].l;
|
||||||
|
if (treeId[a] != treeId[b]) {
|
||||||
|
//cost += l;
|
||||||
|
res[a].addPath(b + 1, l);
|
||||||
|
int oldId = treeId[b], newId = treeId[a];
|
||||||
|
for (int j = 0; j < _amount; ++j) {
|
||||||
|
if (treeId[j] == oldId) {
|
||||||
|
treeId[j] = newId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_dots = res;
|
||||||
|
return Graphs.fromList(_name, res, _useLength, _oriented);
|
||||||
|
}
|
||||||
|
//************Àëãîðèòìû************
|
||||||
|
}
|
||||||
|
|
||||||
|
class LenDotPath {
|
||||||
|
late int l;
|
||||||
|
late int d;
|
||||||
|
late int p;
|
||||||
|
LenDotPath(int len, dot, path) {
|
||||||
|
l = len;
|
||||||
|
d = dot;
|
||||||
|
p = path;
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 8.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 97 KiB |
|
@ -9,12 +9,40 @@
|
||||||
pages = {119},
|
pages = {119},
|
||||||
}
|
}
|
||||||
|
|
||||||
@BOOK {Algo_2013,
|
@BOOK{Algo_2013,
|
||||||
author={Êîðìåí, Òîìàñ Õ. and Ëåéçåðñîí, ×àðëüç È. and Ðèâåñò, Ðîíàëä Ë. and Øòàéí, Êëèôôîðä},
|
author={Êîðìåí, Òîìàñ Õ. and Ëåéçåðñîí, ×àðëüç È. and Ðèâåñò, Ðîíàëä Ë. and Øòàéí, Êëèôôîðä},
|
||||||
title={Àëãîðèòìû: ïîñòðîåíèå è àíàëèç, 2-å èçäàíèå},
|
title={Àëãîðèòìû: ïîñòðîåíèå è àíàëèç, 2-å èçäàíèå},
|
||||||
year={2013},
|
year={2013},
|
||||||
pages={1296},
|
pages={1296},
|
||||||
publisher={Издательский дом \"Вильямс\"},
|
publisher={Èçäàòåëüñêèé äîì ''Âèëüÿìñ''},
|
||||||
|
}
|
||||||
|
|
||||||
|
@Misc{intuit,
|
||||||
|
title={Ëåêöèÿ 45: Àëãîðèòìû íà ãðàôàõ. Àëãîðèòìû îáõîäà ãðàôa. [{Ý}ëåêòðîííûé ðåñóðñ]},
|
||||||
|
note={URL:~\url{https://intuit.ru/studies/courses/648/504/lecture/11474} (Äàòà îáðàùåíèÿ 20.11.2021). Çàãë. ñ ýêð. ßç. ðóñ.},
|
||||||
|
}
|
||||||
|
|
||||||
|
@TechReport{repo,
|
||||||
|
title={Ðåïîçèòîðèé ñ èõîäíûì êîäîì ïðîãðàììû. [{Ý}ëåêòðîííûé ðåñóðñ]},
|
||||||
|
note={URL:~\url{https://morozovad.ddns.net/lnd212/Graphs_dart}}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Manual{dart_web,
|
||||||
|
title={Dart overview. [{Ý}ëåêòðîííûé ðåñóðñ]},
|
||||||
|
note={URL:~\url{https://dart.dev/overview} (Äàòà îáðàùåíèÿ 20.11.2021). Çàãë. ñ ýêð. ßç. àíãë.}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Book{dartInAction,
|
||||||
|
author={Áàêêåò, Ê.},
|
||||||
|
title={Dart â äåéñòâèè},
|
||||||
|
year={2013},
|
||||||
|
pages={528},
|
||||||
|
publisher={ÄÌÊ Ïðåññ},
|
||||||
|
}
|
||||||
|
|
||||||
|
@TechReport{futureOfJavascript,
|
||||||
|
title={Future of Javascript. [{Ý}ëåêòðîííîå ïèñüìî]},
|
||||||
|
note={URL:~\url{https://markmail.org/message/uro3jtoitlmq6x7t}}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Comment{jabref-meta: databaseType:bibtex;}
|
@Comment{jabref-meta: databaseType:bibtex;}
|
||||||
|
|
Loading…
Reference in New Issue