{"id":211558,"date":"2014-02-06T12:28:02","date_gmt":"2014-02-06T08:28:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=211558"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=211558","title":{"rendered":"<span class=\"post_title\">\u041c\u0430\u0441\u043a\u0438\u0440\u0443\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u043f\u043e\u0434 \u0433\u0440\u0430\u0444 Boost. \u0427\u0430\u0441\u0442\u044c 1: \u041d\u0435 \u0442\u0440\u043e\u0433\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/e6a\/b7a\/f80\/e6ab7af80bd2bdba0d725529e3c5cc65.png\" align=\"left\"\/><br \/>  \u041f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0443\u0442\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0438\u0433\u0440\u044b \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c. \u041f\u0440\u043e\u0448\u043b\u044b\u0439 \u0431\u044b\u043b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u044b\u0439 \u2014 \u0448\u0430\u0433 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443, \u0438 \u0432\u0441\u0435 \u043f\u043b\u043e\u0445\u043e\u2026 \u0417\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u0437\u044f\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0438\u0437 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430. \u0422\u0443\u0442-\u0442\u043e \u0438 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432 boost \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0440\u0430\u0444\u0430\u043c\u0438. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043f\u043e\u0434\u0445\u043e\u0434, \u00ab\u043d\u0430\u0439\u0434\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432\u044b\u0437\u043e\u0432\u0438 \u2014 \u0438 \u0432\u0441\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u00bb \u043d\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043b\u0441\u044f. \u0423\u043f\u043e\u0440 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0441\u0434\u0435\u043b\u0430\u043d \u043d\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435. \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043c\u0435\u0440\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u2014 \u0432\u0441\u0435 \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u0441 \u043d\u0443\u043b\u044f \u0434\u0435\u043b\u0430\u0442\u044c (\u0438 \u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c). \u0421 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0442\u043e\u0436\u0435 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u043d\u0435 \u0431\u044b\u043b\u043e, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a boost \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0430\u0432\u043d\u043e\u2026<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0414\u0430\u043d\u043e \u2014 \u043a\u043b\u0430\u0441\u0441 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c (\u0437\u043d\u0430\u0447\u0438\u043c\u044b\u043c \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438) \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c<\/p>\n<pre><code class=\"cpp\">class GameField { public:      GameField();          bool canPass(int x, int y) const;     int getWidth() const;     int getHeight() const; }; <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0441\u0435\u0442\u043a\u0443 \u0438\u0437 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u043a\u043b\u0435\u0442\u043e\u043a. \u0425\u043e\u0434\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0432 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435 \u044f\u0447\u0435\u0439\u043a\u0438 \u043a\u0430\u043a \u043f\u0440\u044f\u043c\u043e, \u0442\u0430\u043a \u0438 \u043f\u043e \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438. \u041c\u0435\u0442\u043e\u0434 <b>GameField::canPass<\/b> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443 (\u0442.\u0435. \u043e\u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438 \u0432 \u043d\u0435\u0439 \u043d\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0430 \u043f\u0440\u0435\u0433\u0440\u0430\u0434\u0430)<\/p>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f\u043c\u0438 boost \u2014 \u043e \u043d\u0438\u0445 \u044f \u043f\u0438\u0441\u0430\u043b \u0432 <a href=\"http:\/\/habrahabr.ru\/post\/210838\/\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>. \u0411\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u0441\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043a \u0433\u0440\u0430\u0444\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u043d\u0430\u0443\u0433\u0430\u0434, \u0447\u0438\u0442\u0430\u0439 \u0432\u0435\u0447\u043d\u043e\u0441\u0442\u044c. \u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0443, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c \u043b\u0438\u0448\u044c \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u0412 \u043d\u0435\u0439 \u0431\u044b\u043b \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438<\/p>\n<pre><code class=\"cpp\">BOOST_CONCEPT_ASSERT((SomeFuncAppropriate&lt;SomeClass&gt;)); <\/code><\/pre>\n<p>  \u042f \u0435\u0449\u0435 \u0436\u0430\u043b\u043e\u0432\u0430\u043b\u0441\u044f, \u0447\u0442\u043e \u0434\u0432\u043e\u0439\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 \u0433\u043b\u0430\u0437\u0430 \u0440\u0435\u0436\u0443\u0442. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0440\u0435\u0437\u0430\u043b\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043d\u0435, \u0438 boost \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442<\/p>\n<pre><code class=\"cpp\">boost::function_requires&lt;SomeFuncAppropriate&lt;SomeClass&gt; &gt;(); <\/code><\/pre>\n<p>  \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u044f \u0431\u0443\u0434\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c.<\/p>\n<p>  \u0418\u0442\u0430\u043a. \u0415\u0441\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u0433\u0440\u0430\u0444, \u0447\u0442\u043e\u0431\u044b boost \u0435\u0433\u043e \u043f\u0440\u0438\u043d\u044f\u043b. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0430\u043c \u043a\u043b\u0430\u0441\u0441 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f (GameField) \u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u2014 \u0437\u0434\u0435\u0441\u044c \u044f \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u0435\u0433\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0431\u0435\u0437 \u0442\u043e\u0433\u043e \u043d\u0435\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439, \u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0440\u0430\u0434\u0438 \u043d\u0435 \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0435\u0439\u0441\u044f \u043a \u043f\u0440\u044f\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0435\u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e. \u0414\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0443\u0442\u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c <a href=\"http:\/\/ru.wikipedia.org\/wiki\/%D0%90%D0%BB%D0%B3%D0%BE%D1%80%D0%B8%D1%82%D0%BC_%D0%BF%D0%BE%D0%B8%D1%81%D0%BA%D0%B0_A*\">A* (AStar)<\/a>. \u0412 <a href=\"http:\/\/www.boost.org\/doc\/libs\/1_55_0\/libs\/graph\/doc\/astar_search.html\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f boost::astar_search \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0442 \u0433\u0440\u0430\u0444\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0434\u0432\u0443\u043c \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f\u043c: <a href=\"http:\/\/www.boost.org\/doc\/libs\/1_55_0\/libs\/graph\/doc\/VertexListGraph.html\">Vertex List Graph<\/a> \u0438 <a href=\"http:\/\/www.boost.org\/doc\/libs\/1_55_0\/libs\/graph\/doc\/IncidenceGraph.html\">Incidence Graph<\/a>. <\/p>\n<ul>\n<li><b>VertexListGraph <\/b> \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043e\u0431\u0445\u043e\u0434\u0430 \u0432\u0441\u0435\u0445 \u0432\u0435\u0440\u0448\u0438\u043d \u0433\u0440\u0430\u0444\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u0435\u0440\u0448\u0438\u043d \u0438 \u0438\u0445 \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430.<\/li>\n<li><b>IncidenceGraph<\/b> \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430 \u0432\u0441\u0435\u0445 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0440\u0435\u0431\u0435\u0440. \u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u043e\u0432 \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0431\u0440\u0430. <\/li>\n<\/ul>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u0433\u0440\u0430\u0444\u043e\u0432 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u044f\u0434\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043e\u043f\u0438\u0440\u0430\u044f\u0441\u044c \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 boost \u0441\u043c\u043e\u0436\u0435\u0442 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c. \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u043d\u0438\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<p>  <b>vertex_descriptor<\/b> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0442\u0438\u043f \u0432\u0435\u0440\u0448\u0438\u043d\u044b. \u0412 \u043a\u043b\u0430\u0441\u0441\u0435 GameField \u0432\u0435\u0440\u0448\u0438\u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0443\u043c\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 \u044f\u0447\u0435\u0439\u043a\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u043c\u044b\u0441\u043b\u044c \u2014 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438\u043b\u0438 \u043f\u0430\u0440\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (std::pair). \u041e\u0434\u043d\u0430\u043a\u043e <b>vertex_descriptor<\/b> \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u0433\u0440\u0430\u0444\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f\u043c, \u0442.\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b, \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b \u0438 \u0442.\u0434. \u041d\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u043e, \u043d\u043e \u043f\u0440\u043e\u0449\u0435 \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f \u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0434\u0432\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f. \u0421\u0430\u043c\u043e \u043f\u043e \u0441\u0435\u0431\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0430 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435) \u043d\u0435 \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442. \u0422\u0430\u043a \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e, \u0447\u0442\u043e \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u0433\u0440\u0430\u0444\u0430 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u043d\u0443\u043c\u0435\u0440\u043e\u0432\u0430\u043d\u044b ((0, 0) -&gt; 0, (0, 1) -&gt; 1 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435). \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0438\u043f\u0430 \u0432\u0435\u0440\u0448\u0438\u043d \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 <b>int<\/b>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0432 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0433\u0440\u0430\u0444\u0430<\/p>\n<pre><code class=\"cpp\">std::pair&lt;int, int&gt; getCoordinates(const Vertex position, const GameField& graph) {     return std::make_pair(position % graph.getWidth(), position \/ graph.getWidth()); } <\/code><\/pre>\n<p>  \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e<\/p>\n<pre><code class=\"cpp\">Vertex getVertex(int x, int y, const GameField& graph) {     return x + y * graph.getWidth(); } <\/code><\/pre>\n<p>  \u041e\u0442\u043a\u0443\u0434\u0430 \u0432\u0437\u044f\u043b\u0441\u044f \u0442\u0438\u043f Vertex \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u043e \u043d\u0438\u0436\u0435.<\/p>\n<p>  <b>edge_descriptor<\/b> \u2014 \u0442\u0438\u043f \u0440\u0435\u0431\u0440\u0430. \u0420\u0435\u0431\u0440\u043e \u2014 \u044d\u0442\u043e \u0434\u0432\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u044b, \u0442\u0430\u043a \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u043c: std::pair &lt;vertex_descriptor, vertex_descriptor&gt;<\/p>\n<p>  <b>directed_category<\/b> \u2014 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u0437 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432-\u0442\u0435\u0433\u043e\u0432 (\u043f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0431\u0435\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432), \u043a\u043e\u0442\u0440\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0433\u0440\u0430\u0444 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 boost::undirected_tag<\/p>\n<p>  <b>edge_parallel_category<\/b> \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u0442\u0438\u043f-\u0442\u0435\u0433, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b \u043b\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u0433\u0440\u0430\u0444\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0431\u0440\u0430 (\u043a\u043e\u0433\u0434\u0430 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0435\u0431\u0440\u0430). \u041d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 boost::disallow_parallel_edge_tag<\/p>\n<p>  <b>traversal_category<\/b> \u0422\u043e\u0436\u0435 \u0442\u0435\u0433. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043e\u0431\u0445\u043e\u0434\u0430 \u0433\u0440\u0430\u0444\u0430. \u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u0414\u043b\u044f VertexListGraph \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c boost::vertex_list_graph_tag, \u0430 \u0434\u043b\u044f IncidenceGraph \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e boost::incidence_graph_tag. \u0420\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043d\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430-\u0442\u0435\u0433\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b \u0431\u044b \u043e\u0431\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043e\u0431\u0445\u043e\u0434\u0430<\/p>\n<pre><code class=\"cpp\">struct game_field_traversal_catetory:     public boost::vertex_list_graph_tag,     public boost::incidence_graph_tag { }; <\/code><\/pre>\n<p>  <b>vertex_iterator<\/b> \u0418\u0442\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043e\u0431\u0445\u043e\u0434\u0430 \u0432\u0435\u0440\u0448\u0438\u043d. \u0415\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>  <b>out_edge_iterator<\/b> \u0418\u0442\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043e\u0431\u0445\u043e\u0434\u0430 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0440\u0435\u0431\u0435\u0440, \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c.<\/p>\n<p>  <b>degree_size_type<\/b> \u0422\u0438\u043f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0432\u0435\u0440\u0448\u0438\u043d\u044b (\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0440\u0435\u0431\u0435\u0440). \u0426\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e.<\/p>\n<p>  <b>vertices_size_type<\/b> \u0422\u0438\u043f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0435\u0440\u0448\u0438\u043d \u0433\u0440\u0430\u0444\u0430. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u043c \u0437\u0430 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e.<\/p>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c \u043d\u0430 \u0442\u0438\u043f\u0430\u0445-\u0442\u0435\u0433\u0430\u0445 (\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u044d\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"http:\/\/www.boost.org\/community\/generic_programming.html#tag_dispatching\">\u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0435\u0433\u043e\u0432<\/a>). \u041e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u0439 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043c\u043e\u0434\u0435\u043b\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0432 \u0442\u0435\u0433 boost::undirected_tag, \u043c\u044b \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435, \u0447\u0442\u043e \u0440\u0435\u0431\u0440\u0430 \u0433\u0440\u0430\u0444\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0440\u0435\u0431\u0435\u0440. <\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0438\u043f\u044b \u0438\u0433\u0440\u043e\u0432\u043e\u043c\u0443 \u043f\u043e\u043b\u044e. \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u2014 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043a\u043b\u0430\u0441\u0441\u0435. <\/p>\n<pre><code class=\"cpp\">class GameField { public:         typedef int vertex_descriptor; ... <\/code><\/pre>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 GameField \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, boost \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0430\u043a\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u0412\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u043d\u0435 \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u0430 \u0433\u0440\u0430\u0444\u0430 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0435 \u0442\u0430\u043a<\/p>\n<pre><code class=\"cpp\">GameField::vertex_descriptor <\/code><\/pre>\n<p>  \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d <b>boost::graph_traits<\/b><\/p>\n<pre><code class=\"cpp\">boost::graph_traits&lt;GameField&gt;::vertex_iterator <\/code><\/pre>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0442\u0438\u043f \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u0430-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u0442.\u0435. \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435<\/p>\n<pre><code class=\"cpp\">  template &lt;typename Graph&gt;   struct graph_traits {     typedef typename Graph::vertex_descriptor vertex_descriptor; ... <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e graph_traits \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 GameField, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c, \u043a\u0430\u043a \u043d\u0430\u043c \u0443\u0434\u043e\u0431\u043d\u043e, \u0442.\u0435. \u043d\u0435 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0438\u0441\u043a\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u0432 \u0438\u0433\u0440\u043e\u0432\u043e\u043c \u043f\u043e\u043b\u0435. \u0412\u044b\u0448\u0435 \u0431\u044b\u043b \u043e\u043f\u0438\u0441\u0430\u043d \u0432\u044b\u0431\u043e\u0440 \u0442\u0438\u043f\u043e\u0432 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0435 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d boost.<\/p>\n<pre><code class=\"cpp\">namespace boost {    template &lt;&gt; struct graph_traits&lt;GameField&gt;     {         typedef int vertex_descriptor;         typedef std::pair &lt;vertex_descriptor, vertex_descriptor&gt; edge_descriptor;         typedef boost::undirected_tag directed_category;         typedef boost::disallow_parallel_edge_tag edge_parallel_category;         typedef game_field_traversal_catetory traversal_category;                  typedef VertexIteratorImpl vertex_iterator;         typedef OutEdgeIteratorImpl out_edge_iterator;         typedef int degree_size_type;         typedef int vertices_size_type;                  typedef void in_edge_iterator;         typedef void edge_iterator;         typedef void edges_size_type;     }; } <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u043d\u0435\u0435 \u043d\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u0438\u0441\u044c: in_edge_iterator, edge_iterator, edges_size_type. \u041e\u043d\u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0439 VertexListGraph \u0438 IncidenceGraph, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0443\u0442\u043e\u0447\u043d\u044f\u0442\u044c (\u0441\u0434\u0435\u043b\u0430\u0442\u044c <b>void<\/b>).<\/p>\n<p>  \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0442\u0438\u043f\u044b \u0432 graph_traits (\u0442.\u0435. \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c vertex_descriptor \u0432\u043c\u0435\u0441\u0442\u043e int, \u0435\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u0432\u0435\u0440\u0448\u0438\u043d\u0435), \u0447\u0442\u043e\u0431\u044b \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0432\u0438\u0434\u0430 <b>boost::graph_traits&#038;ltGameField&#038;gt::vertex_descriptor<\/b> \u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0430\u0442\u0430 \u043a\u0430\u043a \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f, \u0432\u0432\u0435\u0434\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0442\u0438\u043f\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c <\/p>\n<pre><code class=\"cpp\">typedef boost::graph_traits&lt;GameField&gt;::vertex_descriptor Vertex; typedef boost::graph_traits&lt;GameField&gt;::edge_descriptor Edge; typedef boost::graph_traits&lt;GameField&gt;::vertex_iterator VertexIterator; typedef boost::graph_traits&lt;GameField&gt;::out_edge_iterator OutEdgeIterator; typedef boost::graph_traits&lt;GameField&gt;::degree_size_type DegreeSizeType; <\/code><\/pre>\n<p>  \u0412\u0441\u0451, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b. \u0412 <b>graph_traits&#038;ltGameField&#038;gt<\/b> \u0431\u044b\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b <b>VertexIteratorImpl<\/b> \u0438 <b>OutEdgeIteratorImpl<\/b> \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u044d\u0442\u0438\u0445 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438. \u0422\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0440\u0430\u0444\u0430\u043c\u0438.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/211558\/\"> http:\/\/habrahabr.ru\/post\/211558\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/e6a\/b7a\/f80\/e6ab7af80bd2bdba0d725529e3c5cc65.png\" align=\"left\"\/><br \/>  \u041f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0443\u0442\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0438\u0433\u0440\u044b \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c. \u041f\u0440\u043e\u0448\u043b\u044b\u0439 \u0431\u044b\u043b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u044b\u0439 \u2014 \u0448\u0430\u0433 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443, \u0438 \u0432\u0441\u0435 \u043f\u043b\u043e\u0445\u043e\u2026 \u0417\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u0437\u044f\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0438\u0437 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430. \u0422\u0443\u0442-\u0442\u043e \u0438 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432 boost \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0440\u0430\u0444\u0430\u043c\u0438. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043f\u043e\u0434\u0445\u043e\u0434, \u00ab\u043d\u0430\u0439\u0434\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432\u044b\u0437\u043e\u0432\u0438 \u2014 \u0438 \u0432\u0441\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u00bb \u043d\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043b\u0441\u044f. \u0423\u043f\u043e\u0440 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0441\u0434\u0435\u043b\u0430\u043d \u043d\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435. \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043c\u0435\u0440\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u2014 \u0432\u0441\u0435 \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u0441 \u043d\u0443\u043b\u044f \u0434\u0435\u043b\u0430\u0442\u044c (\u0438 \u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c). \u0421 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0442\u043e\u0436\u0435 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u043d\u0435 \u0431\u044b\u043b\u043e, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a boost \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0430\u0432\u043d\u043e\u2026  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-211558","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/211558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=211558"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/211558\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=211558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=211558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=211558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}