{"id":308608,"date":"2020-08-17T21:00:19","date_gmt":"2020-08-17T21:00:19","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=308608"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=308608","title":{"rendered":"\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043d\u0430 TypeScript. \u0422\u0435\u043e\u0440\u0438\u044f \u0433\u0440\u0430\u0444\u043e\u0432 \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u043b\u0430\u0441\u044c"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/515554\/\">\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0438\u0437\u0432\u0435\u0447\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432:<\/p>\n<p>  <\/p>\n<blockquote><p>\u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d?<\/p><\/blockquote>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0432\u0443\u0447\u0438\u0442 \u0442\u0430\u043a: &quot;\u041f\u0440\u043e\u0435\u043a\u0442 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0437\u0430\u0434\u0430\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u0435\u0445 \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0435\u0439. \u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d?&quot;<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vz\/e7\/k9\/vze7k9hw4mnz4hh9lh28t8wn104.png\" alt=\"\u041a\u0414\u041f\u0412 \u0415\u0436\u0435\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\"><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h3 id=\"nebolshaya-predystoriya\">\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h3>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0427\u0435\u043c \u044f \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0438 \u043a\u0430\u043a \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0448\u0435\u043b<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u0421 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u0433\u043e\u0434\u0430 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432 \u0440\u043e\u043b\u0438 \u0442\u0435\u0445\u043b\u0438\u0434\u0430. \u0412 \u043c\u043e\u043c\u0435\u043d\u0442\u0435 \u044f \u043e\u0442\u0432\u0435\u0447\u0430\u043b \u0437\u0430 3 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u0441 11 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438, 2 \u043f\u0440\u043e\u0434\u0430\u043a\u0442\u0430\u043c\u0438, 2 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u0430\u043c\u0438 \u0438 \u0440\u044f\u0434\u043e\u043c \u0441\u043c\u0435\u0436\u043d\u0438\u043a\u043e\u0432 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u0442\u0434\u0435\u043b\u043e\u0432. \u041f\u0440\u043e\u0435\u043a\u0442\u044b \u043a\u0440\u0443\u043f\u043d\u044b\u0435, \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b \u043e\u043a\u043e\u043b\u043e 300 \u0442\u0438\u043a\u0435\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u042f\u043d\u0434\u0435\u043a\u0441.\u0422\u0440\u0435\u043a\u0435\u0440. \u0423\u0432\u044b, \u0422\u0440\u0435\u043a\u0435\u0440 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0434\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0438\u0437\u0432\u0435\u0447\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: &quot;\u041a\u043e\u0433\u0434\u0430?&quot;. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u044b \u0440\u0443\u043a\u0430\u043c\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 Omniplan, \u0447\u0442\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043e\u0431\u0449\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443 \u043f\u043e \u0441\u0440\u043e\u043a\u0430\u043c. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0421\u0430\u043c\u0430\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0434\u043b\u044f \u043d\u0430\u0441 \u0444\u0438\u0447\u0430 \u2014 \u044d\u0442\u043e \u0430\u0432\u0442\u043e-\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0438 \u043e\u0434\u0438\u043d \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a \u043d\u0435 \u0431\u044b\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0435\u0434\u0438\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c \u043d\u0430 100%.<\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, Omniplan \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u043c\u0438\u043d\u0443\u0441\u044b:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041c\u0435\u0434\u043b\u0435\u043d\u043d\u0430\u044f \u0438 \u043d\u0435\u043d\u0430\u0434\u0435\u0436\u043d\u0430\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0447\u043b\u0435\u043d\u0430\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043f\u0438\u0438.<\/li>\n<li>\u0422\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f MacOS<\/li>\n<li>\u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0442\u0440\u0435\u043a\u0435\u0440\u043e\u043c<\/li>\n<li>\u0414\u043e\u0440\u043e\u0433\u043e\u0432\u0430\u0442: $200 \u0438\u043b\u0438 $400 \u0437\u0430 Pro \u0440\u0435\u0434\u0430\u043a\u0446\u0438\u044e.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u042f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 Omniplan c \u0431\u043b\u044d\u043a\u0434\u0436\u0435\u043a\u043e\u043c \u0438 \u043f\u0440.:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0432\u0435\u0431\u0435<\/li>\n<li>\u041f\u0440\u043e\u0441\u0442\u0430\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u043d\u0430\u0448\u0438\u043c \u0442\u0440\u0435\u043a\u0435\u0440\u043e\u043c<\/li>\n<li>Real-time \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043d\u0430\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0421\u0430\u043c\u0430\u044f \u0432\u0435\u0441\u0435\u043b\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u2014 \u044d\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0430\u0432\u0442\u043e-\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447. \u042f \u0438\u0437\u0443\u0447\u0438\u043b \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043b, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u043e\u043b\u044c\u043a\u043e Omniplan \u0438\u043c\u0435\u0435\u0442 \u044d\u0442\u0443 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u043d\u0443\u044e \u0444\u0438\u0447\u0443. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043d\u0438\u043c\u0430\u044e.<\/p>\n<\/div><\/div>\n<p>  <\/p>\n<h3 id=\"predvaritelnye-issledovaniya\">\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0435 \u043d\u0430\u0439\u0434\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0430\u0432\u0442\u043e-\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447. \u041c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0443\u043c\u0435\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0440\u0435\u043a\u0435\u0440\u0430 \u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0435 \u0431\u044b\u043b\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 100%.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043f\u043e\u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b \u0432\u043e\u043f\u0440\u043e\u0441, \u0432\u0435\u0434\u044c \u0432\u0441\u0451 \u0443\u0436\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043d\u043e \u0434\u043e \u043d\u0430\u0441. <\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0448\u0435\u043b \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u0440\u043e <a href=\"https:\/\/en.wikipedia.org\/wiki\/Gantt_chart\" rel=\"nofollow\">\u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u0413\u0430\u043d\u0442\u0430<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Program_evaluation_and_review_technique\" rel=\"nofollow\">PERT<\/a>, \u043d\u043e \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043c\u043d\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u043e\u0438\u0441\u043a\u0430\u043b open-source \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043d\u0430\u0448\u0435\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443: <a href=\"https:\/\/github.com\/bryntum\/chronograph\" rel=\"nofollow\">Bryntum Chronograph<\/a>. \u041f\u043e\u0445\u043e\u0436\u0435, \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e! \u0423 \u043d\u0438\u0445 \u0434\u0430\u0436\u0435 \u0435\u0441\u0442\u044c <a href=\"https:\/\/github.com\/bryntum\/scheduler-performance\" rel=\"nofollow\">\u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438<\/a>. \u041d\u043e, \u0447\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043f\u043e\u043d\u044f\u043b <a href=\"https:\/\/github.com\/bryntum\/chronograph\/blob\/master\/src\/chrono\/Graph.ts\" rel=\"nofollow\">\u043a\u043e\u0434 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/a>, \u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u043c\u043e\u0433\u043b\u043e. \u0412 \u043e\u0431\u0449\u0435\u043c, \u043d\u0430\u0434\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0435.<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/q1\/vk\/dp\/q1vkdpq_vbfu6qlmnsxesmsvtii.png\" alt=\"\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438\"><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043a\u0430 \u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043b \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443, \u043c\u0435\u043d\u044f \u043e\u0441\u0435\u043d\u0438\u043b\u043e: \u0430 \u0432\u0435\u0434\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444, \u0433\u0434\u0435 \u0440\u0435\u0431\u0440\u0430 \u2014 \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u044f\u0432\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438, \u043d\u043e \u0438 \u043d\u0435\u044f\u0432\u043d\u044b\u0435. \u041d\u0435\u044f\u0432\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c.<\/p>\n<p>  <\/p>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0442\u0430\u043a\u043e\u0439 \u0440\u0430\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0437\u0430\u0434\u0430\u0447 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wd\/vj\/z9\/wdvjz9fr6u8jsb2awun8gtvmjwe.png\" alt=\"\u0416\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\"><\/p>\n<p>  <\/p>\n<h3 id=\"anatomiya-zadachi\">\u0410\u043d\u0430\u0442\u043e\u043c\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438<\/h3>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0438\u0437 \u0447\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0434\u0430\u0447\u0430:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ah\/v9\/ye\/ahv9ye3bgsjbf7xyamw9o7acrfs.png\" alt=\"\u0410\u043d\u0430\u0442\u043e\u043c\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438\"><\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u0440\u044f\u0434 \u043d\u0430 \u0442\u0430\u043a\u0438\u0445 \u0443\u0436 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0443 \u0437\u0430\u0434\u0430\u0447\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li><strong>\u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/strong>. \u0417\u0430\u0434\u0430\u0447\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 <em>\u0440\u0430\u0431\u043e\u0447\u0438\u0435<\/em> \u0434\u043d\u0438. \u041e\u0446\u0435\u043d\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u2014 \u0447\u0438\u0441\u043b\u043e <em>\u0440\u0430\u0431\u043e\u0447\u0438\u0445<\/em> \u0434\u043d\u0435\u0439. \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 2 \u043c\u0430\u0440\u0442\u0430, \u0438\u043c\u0435\u0435\u0442 \u043e\u0446\u0435\u043d\u043a\u0443 \u0432 6 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0434\u043d\u0435\u0439 \u0438 \u0435\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f 9 \u043c\u0430\u0440\u0442\u0430. \u0412\u0430\u0436\u043d\u043e, \u0447\u0442\u043e \u043d\u0435 7 \u041c\u0430\u0440\u0442\u0430, \u0442.\u043a. 7 \u0438 8 \u043c\u0430\u0440\u0442\u0430 \u2014 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435.<\/li>\n<li><strong>\u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0438<\/strong>. \u0411\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0447\u0435\u043c \u0432\u044b\u0448\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435, \u0442\u0435\u043c \u0440\u0430\u043d\u044c\u0448\u0435 \u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u043d\u0430, \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043e\u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u0430.<\/li>\n<li><strong>\u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/strong>. \u041f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430\u0445 \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u0434\u043d\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b\u0438 \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043e\u0446\u0435\u043d\u0438\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 4 \u0434\u043d\u044f, \u0430 \u0435\u0435 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 75%, \u0437\u043d\u0430\u0447\u0438\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c 1 \u0434\u0435\u043d\u044c.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412 \u043d\u043e\u0442\u0430\u0446\u0438\u0438 Typescript \u0437\u0430\u0434\u0430\u0447\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">export type Task = {   id: ID;   \/\/ ID \u2014 alias for string   title: string;   start: Date;   end: Date;   duration: number;   position: number;  \/\/ \u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442   progress: number;   resourceId: ID;   dependencies?: ID[]; };<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"algoritm\">\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c<\/h2>\n<p>  <\/p>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0434\u0430\u0442\u044b \u0437\u0430\u0434\u0430\u0447 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u0417\u0430\u0434\u0430\u0447\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0434\u043d\u044f, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/li>\n<li>\u0417\u0430\u0434\u0430\u0447\u0443 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0441\u0435\u0433\u043e\u0434\u043d\u044f, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043d\u0435\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u044f\u0442, \u044f\u0432\u043d\u043e \u0438\u043b\u0438 \u043d\u0435\u044f\u0432\u043d\u043e. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0437\u0430\u0434\u0430\u0447\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043d\u0430\u0447\u0430\u0442\u044c\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0430\u0442\u0441\u044f.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0448\u0430\u0433\u043e\u0432:<\/p>\n<p>  <\/p>\n<p>1) <strong>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u0433\u0440\u0430\u0444 \u0437\u0430\u0434\u0430\u0447<\/strong>. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0440\u0435\u0431\u0440\u0430 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u044f\u0432\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438\u043b\u0438 \u043d\u0435\u044f\u0432\u043d\u044b\u0445 \u043f\u043e \u043e\u0431\u0449\u0435\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044e.<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/** * Graph respects explicit dependencies  * and implicit by resources (via positions)  *\/ export const makeGraphFromTasks = (tasks: Task[]): Graph =&gt; {   const graph: Graph = new Map();   const resources = new Map&lt;ID, Task[]&gt;();    \/\/ add edges for deps by resourceId and explicit dependencies   for (const t of tasks) {     const tasksForResource = resources.get(t.resourceId) ?? [];     tasksForResource.push(t);     resources.set(t.resourceId, tasksForResource);      graph.set(t.id, new Set(t.dependencies ?? []));   }    for (const tasksForResource of resources.values()) {     \/\/ sort by position     tasksForResource.sort((a, b) =&gt; a.position - b.position);      \/\/ add to graph such edges so first node has second as dependency     let prevTask: Task | undefined;     for (const task of tasksForResource) {       if (prevTask) {         graph.get(prevTask.id)?.add(task.id);       }       prevTask = task;     }   }    return graph; };<\/code><\/pre>\n<p>  <\/p>\n<p>2) <strong>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 (\u0442\u0440\u0430\u043d\u0441\u043f\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439) \u0433\u0440\u0430\u0444<\/strong>. \u042d\u0442\u043e\u0442 \u0433\u0440\u0430\u0444 \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0441\u0442\u043e\u043a\u0438 (\u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438 \u0440\u0435\u0431\u0440\u0430\u043c\u0438), \u0438\u0441\u0442\u043e\u043a\u0438 (\u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438 \u0440\u0435\u0431\u0440\u0430\u043c\u0438) \u0438 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u044b (\u0431\u0435\u0437 \u0440\u0435\u0431\u0435\u0440).<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0445\u043e\u0434\u0430 \u043f\u043e \u0432\u0441\u0435\u043c \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D0%BE%D0%B8%D1%81%D0%BA_%D0%B2_%D0%B3%D0%BB%D1%83%D0%B1%D0%B8%D0%BD%D1%83\" rel=\"nofollow\">\u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0432 \u0433\u043b\u0443\u0431\u0438\u043d\u0443<\/a>. \u042f \u043f\u0440\u0438\u0432\u0435\u043b \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e-\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u043e \u0433\u0440\u0430\u0444\u0443. <\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">export const makeReverseGraph = (graph: Graph): Graph =&gt; {   const reverseGraph: Graph = new Map();    for (const [id, parentId] of dfs(graph, { withParentId: true })) {     const prerequesitions = reverseGraph.get(id) ?? new Set();     if (parentId) {       prerequesitions.add(parentId);     }     reverseGraph.set(id, prerequesitions);   }    return reverseGraph; };  \/**  * Iterate over every node.  * If withParentId = true, than it is possible to visit same not more then once  * @yields {[string, string?]} [nodeId, parentNodeId?]  *\/ export function* dfs(   graph: Graph,   options: { withParentId: boolean } = { withParentId: false } ): Generator&lt;readonly [string, string?], void, void&gt; {   const visited = new Set&lt;ID&gt;();    \/\/ DFS interative   \/\/ iterate over all nodes in case of disconnected graph   for (const node of graph.keys()) {     if (visited.has(node)) {       continue;     }      const stack: ID[] = [node];     while (stack.length &gt; 0) {       const currentNode = stack.pop();       assertIsDefined(currentNode);        yield [currentNode];        visited.add(currentNode);        const dependencies = graph.get(currentNode);       if (!dependencies) {         continue;       }       for (const dependencyId of dependencies) {         if (options.withParentId) {           \/\/ possible to yield same nodeId multiple times (needed for making reverse graph)           yield [dependencyId, currentNode];         }          if (visited.has(dependencyId)) {           continue;         }          stack.push(dependencyId);       }     }   } }  export const makeReverseGraph = (graph: Graph): Graph =&gt; {   const reverseGraph: Graph = new Map();    for (const [id, parentId] of dfs(graph, { withParentId: true })) {     const prerequisites = reverseGraph.get(id) ?? new Set();     if (parentId) {       prerequisites.add(parentId);     }     reverseGraph.set(id, prerequisites);   }    return reverseGraph; };  \/**  * Iterate over every node.  * If withParentId = true, than it is possible to visit same not more then once  * @yields {[string, string?]} [nodeId, parentNodeId?]  *\/ export function* dfs(   graph: Graph,   options: { withParentId: boolean } = { withParentId: false } ): Generator&lt;readonly [string, string?], void, void&gt; {   const visited = new Set&lt;ID&gt;();    \/\/ DFS interative   \/\/ iterate over all nodes in case of disconnected graph   for (const node of graph.keys()) {     if (visited.has(node)) {       continue;     }      const stack: ID[] = [node];     while (stack.length &gt; 0) {       const currentNode = stack.pop();       assertIsDefined(currentNode);        yield [currentNode];        visited.add(currentNode);        const dependencies = graph.get(currentNode);       if (!dependencies) {         continue;       }       for (const dependencyId of dependencies) {         if (options.withParentId) {           \/\/ possible to yield same nodeId multiple times (needed for making reverse graph)           yield [dependencyId, currentNode];         }          if (visited.has(dependencyId)) {           continue;         }          stack.push(dependencyId);       }     }   } }<\/code><\/pre>\n<p>  <\/p>\n<p>3) <strong>\u041f\u043e\u0441\u0435\u0442\u0438\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u0432\u0435\u0440\u0448\u0438\u043d\u0443 \u0433\u0440\u0430\u0444\u0430 (\u0437\u0430\u0434\u0430\u0447\u0443) \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u043c \u0434\u0430\u0442\u044b \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430<\/strong>. \u041f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u0448\u0438\u043d \u0434\u043e\u043b\u0436\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0441 \u0437\u0430\u0434\u0430\u0447 \u0441 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u0438\u0441\u0442\u043e\u043a (\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0438 \u0443 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f \u043d\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u043d\u044c\u0448\u0435) \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u044d\u0442\u043e \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0448\u0438\u043d\u0430 (\u043d\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u0441\u0430\u043c\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c\u044e), \u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0441\u0435\u0433\u043e\u0434\u043d\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443 \u0437\u0430\u0434\u0430\u0447\u0438 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043d\u0430\u0447\u0430\u0442\u044c\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0430\u0442\u0441\u044f \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432\u0430\u0436\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u0442\u044b \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043c\u0435\u043d\u044f\u0435\u043c \u0434\u0430\u0442\u0443 \u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0438. \u041d\u0430\u0434\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u043d\u0438 \u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>  <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u043e \u043a\u043e\u0434\u0443 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u0435 \u043e\u0442\u0441\u044b\u043b\u043a\u0443 \u043a \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443 \u0411\u0435\u043b\u043b\u043c\u0430\u043d\u0430-\u0424\u043e\u0440\u0434\u0430. \u0422\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0445\u043e\u0436\u0430\u044f \u0442\u0435\u0445\u043d\u0438\u043a\u0430: \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430 \u0437\u0430\u0434\u0430\u0447 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u0434\u0430\u0442\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0443\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f.<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">export const scheduleTasks = (tasks: Task[], today?: Date) =&gt; {   const graph = makeGraphFromTasks(tasks);   const tasksById = tasks.reduce((map, task) =&gt; {     map[task.id] = task;     return map;   }, {} as { [id: string]: Task });    \/\/ @TODO: 0. Detect cycles, if present throw error    \/\/ 1. Make reverse graph, to detect sinks and sources   const reverseGraph = makeReverseGraph(graph);    \/\/ 2. If node is source, t.start = max(today, t.start)   \/\/ Repeat until dates remains unchanged, max graph.size times.   \/\/ Similar to optimization in Bellman-Ford algorithm   \/\/ @see https:\/\/en.wikipedia.org\/wiki\/Bellman\u2013Ford_algorithm#Improvements   for (let i = 0; i &lt;= graph.size; i++) {     let datesChanged = false;      for (const [id] of dfs(graph)) {       const t = tasksById[id];        const isSource = reverseGraph.get(id)?.size === 0;       const isSink = graph.get(id)?.size === 0;       const isDisconnected = isSource &amp;&amp; isSink;        if (isSource || isDisconnected) {         datesChanged = updateStartDate(t, today ?? new Date());       } else {         const prerequesionsEndDates = Array.from(           reverseGraph.get(id) ?? []         ).map((id) =&gt; tasksById[id].end);         datesChanged = updateStartDate(           t,           addBusinessDays(max(prerequesionsEndDates), 1)         );       }     }      if (datesChanged === false) {       break;     }   }    return tasks; };  \/**  * Update task dates, according to startDate change  * @returns false if date didn't change, true if it changed  *\/ export const updateStartDate = (task: Task, startDate: Date) =&gt; {   const correctedStartDate = shiftToFirstNextBusinessDay(startDate);   const daysSpent = Math.floor(task.duration * task.progress);   const newStartDate = subBusinessDays(correctedStartDate, daysSpent);    if (isEqual(task.start, newStartDate)) {     return false;   }    task.start = subBusinessDays(correctedStartDate, daysSpent);   \/\/ -1 because every task is minimum 1 day long,   \/\/ say it starts and ends on same date, so it has 1 day duration   task.end = addBusinessDays(task.start, task.duration - 1);    return true; };<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"chto-mozhno-uluchshit\">\u0427\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c<\/h2>\n<p>  <\/p>\n<ol>\n<li><strong>\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/strong>. \u0415\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u0410 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0437\u0430\u0434\u0430\u0447\u0438 \u0411 \u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u0411 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0437\u0430\u0434\u0430\u0447 \u0410, \u0442\u043e \u0432 \u0433\u0440\u0430\u0444\u0435 \u0435\u0441\u0442\u044c \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0430\u043c\u0438 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0440\u0430\u0437\u0440\u0443\u043b\u0438\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0430 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u044f\u0432\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0433\u0434\u0435 \u043e\u043d\u0430 \u043d\u0430\u0439\u0434\u0435\u043d\u0430. \u042d\u0442\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0434\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0430 \u0437\u0430\u0434\u0430\u0447, \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u044f \u0435\u0433\u043e \u0442\u0443\u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044e.)<\/li>\n<li>\u041f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e, \u043e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u2014 \u044d\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435<strong> \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0439 \u0434\u0430\u0442\u044b \u0441\u0442\u0430\u0440\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/strong>. \u0415\u0441\u043b\u0438 \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u044d\u0442\u043e \u0432\u0441\u0435 \u0432\u044b\u0440\u0430\u0441\u0442\u0435\u0442 \u0432 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441, \u0434\u0443\u043c\u0430\u044e, \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c. \u0421\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0443 \u0437\u0430\u0434\u0430\u0447.<\/li>\n<li>\u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043e\u0442\u043f\u0443\u0441\u043a\u043e\u0432 \u0438 \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a\u043e\u0432. \u0414\u0443\u043c\u0430\u044e, \u044d\u0442\u043e \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>updateStartDate.<\/strong><\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0434\u043d\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u043a\u0432\u0430\u043d\u0442\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043c\u043e\u0438\u0445 \u0437\u0430\u0434\u0430\u0447. \u041d\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0430\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0447\u0430\u0441\u043e\u0432\u043e\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.<\/li>\n<\/ol>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u0441 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/DimitryDushkin\/project-tasks-scheduling-engine\" rel=\"nofollow\">\u043d\u0430 \u043c\u043e\u0435\u043c GitHub<\/a>. \u0422\u0430\u043a\u0436\u0435 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043a\u0430\u043a <a href=\"https:\/\/www.npmjs.com\/package\/project-tasks-scheduling-engine\" rel=\"nofollow\">NPM-\u043f\u0430\u043a\u0435\u0442<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0435\u0441\u0442\u044c \u043b\u0438 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435. \u0421 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u0441 \u0432\u0430\u043c\u0438 \u044d\u0442\u043e \u043e\u0431\u0441\u0443\u0436\u0443 \u0442\u0443\u0442 \u0438\u043b\u0438 \u0432 <a href=\"https:\/\/github.com\/DimitryDushkin\/project-tasks-scheduling-engine\/issues\" rel=\"nofollow\">issues \u0441\u0435\u043a\u0446\u0438\u0438 \u043d\u0430 GitHub<\/a>.<\/p>\n<\/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=\"https:\/\/habr.com\/ru\/post\/515554\/\"> https:\/\/habr.com\/ru\/post\/515554\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/515554\/\">\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0438\u0437\u0432\u0435\u0447\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432:<\/p>\n<p>  <\/p>\n<blockquote><p>\u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d?<\/p><\/blockquote>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0432\u0443\u0447\u0438\u0442 \u0442\u0430\u043a: &quot;\u041f\u0440\u043e\u0435\u043a\u0442 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0437\u0430\u0434\u0430\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u0435\u0445 \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0435\u0439. \u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d?&quot;<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vz\/e7\/k9\/vze7k9hw4mnz4hh9lh28t8wn104.png\" alt=\"\u041a\u0414\u041f\u0412 \u0415\u0436\u0435\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\"><\/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-308608","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/308608","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=308608"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/308608\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=308608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=308608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=308608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}