éè·¯ã°ã©ãã®ããŒã¿ã¯ãããŸããããã©ã€ãã©ãªãããã«ãŠã§ã¢ã«æåºããã®ã¯ããã»ã©ç°¡åã§ã¯ãããŸããã§ããã ççŽã«èšã£ãŠãããã«ãŠã§ã¢ããã²ãŒã·ã§ã³ãèŠã€ãããŸããã§ããããã®ãããåã«ã·ã¹ãã ã«çµ±åãããŸããïŒèª°ããã©ããèŠãã°ãããæããŠãããŠããããšãïŒã ãã®ãããæ¢åã®ã©ã€ãã©ãªãæ倧éã«äœ¿çšããŠããã¹ãŠèªåã§è¡ãããšã«ããŸããã
ãµãŒãã¹ã®éçºããã»ã¹ã«ã€ããŠèª¬æããŸãã
ã°ã©ãã«ã€ããŠã
ããŒã¿ã«é¢ããããã€ãã®èšèã ãµãŒãããŒãã£ã®ãããã€ããŒããããŒã¿ãåãåããŸã;ããŒã¿ã®åœ¢åŒãšæ§æã«åœ±é¿ãäžããããšã¯ã§ããŸããã éè·¯ããŒã¿ã¯ãArcViewïŒShapefileïŒåœ¢åŒã®ãã¡ã€ã«ã®åœ¢åŒã§ãã ãã¹ãŠã®éè·¯ã¯äº€å·®ç¹ãã亀差ç¹ãŸã§ã®ã»ã°ã¡ã³ãã«åå²ãããå±æ§ã¯åã»ã°ã¡ã³ãã«é¢é£ä»ããããŸãã
-äžæã®ã»ã°ã¡ã³ãèå¥å
-éè·¯ã®äžéšãæãã幟äœåŠçãªç Žç·
-亀éã«ãŒã«ã®èš±å®¹æ倧é床ã«é¢ããããŒã¿
-ã»ã°ã¡ã³ãã®æåãšæåŸã®å転ã®å¯èœæ§ã«é¢ããããŒã¿
-ã»ã°ã¡ã³ãäžã®äžæ¹éè¡ã®æšè
-Zã¯ãã»ã°ã¡ã³ãã®éå§ãšçµäºã®ã¬ãã«ã§ãïŒããšãã°ãéžæ©ãžã®å ¥ãå£ã¯ãéå§ã¬ãã«0ãšçµäºã¬ãã«1ã«ãããŸãïŒ
ããã«ãããžãã¯ããã©ãã£ãã¯ã«ãŒã«ã«ãã£ãŠç§»åå¶éã課ãããå¥ã®ãã¡ã€ã«ããããŸãã åå¶éã¯ãé 次移åãçŠæ¢ãããŠããïŒæåã®ãã¡ã€ã«ããã®ïŒéè·¯ã»ã°ã¡ã³ããåç §ããèå¥åã®ãã¯ãã«ã§ãã
ããããã¹ãŠã©ã®ããã«èŠãããã®äŸã¯ãæçš¿ã®ã¿ã€ãã«ã«ã¶ãäžãã£ãŠããŸãïŒèµ€-çŠæ¢ãæ®å¿µãªããšã«ããã®å Žåã®ãœãããŠã§ã¢ã§ã¯ãæ¹åãæå®ããŠçŠæ¢ãæç»ããããšã¯ã§ããŸããïŒã
ã¢ã«ãŽãªãºã ãã°ã©ãã§æ©èœããã«ã¯ãã°ã©ããäžè¬ã«åãå ¥ããããŠãã圢åŒãããšãã°ãæ¥ç¶ãããé ç¹ã®ãªã¹ããæ¥ç¶æ§ã®ãããªãã¯ã¹ã®åœ¢åŒã§è¡šç€ºãããããšãå¿ èŠã§ãã ã€ãŸããé ç¹ã®ããŒã¿ãšãããã®éã®é¢ä¿ãå®éã«å¿ èŠã§ãã ããŒã¿å ã®é ç¹ã«é¢ããæ å ±ã¯éåžžã«äžå®å šã§ããããããããã®å¹ŸäœåŠçäœçœ®ã«é¢ããããŒã¿ã®ã¿ãããããã¹ãŠã®é ç¹ãäžæã®èå¥åãååŸããããã«åŠçããå¿ èŠããããŸããã
é ç¹ã®å¹ŸäœåŠçäœçœ®ãåºæºãšããŠåããŸãããã1ã€ã®ç¶æ³ããããŸããïŒã»ã°ã¡ã³ãã®çµäºé ç¹ã®åº§æšã¯ãããšãã°äº€å·®ç¹ã§åžžã«100ïŒ äžèŽããããã§ã¯ãããŸããïŒGISã·ã¹ãã ãªãã¬ãŒã¿ãŒã®äœæ¥ã«æ¬ é¥ããããããããŸãããã確ãã§ã¯ãããŸããïŒã ãããã£ãŠãã°ã©ãã®1ã€ã®é ç¹ãšããŠãåãZã¬ãã«ãæã¡ã1ã¡ãŒãã«ä»¥äžé¢ããŠããªãã»ã°ã¡ã³ãã®ãã¹ãŠã®ç«¯ç¹ãèæ ®ããããšã«ããŸããã
ããŒã¿ã«ã¯çŽ140,000ã®éè·¯éè·¯ãããã¯ãŒã¯ã®ã»ã°ã¡ã³ãããããããã¯çŽ280,000ã®ãšã³ããã€ã³ããæå³ããŸãããããã£ãŠãåãã€ã³ãããæ倧1ã¡ãŒãã«ã®è·é¢ã«ãããã¹ãŠã®è¿é£ãèŠã€ããã«ã¯ãäœããã®éæ£é¢ã¢ã«ãŽãªãºã ãå¿ èŠã§ãã ãã¹ãŠã®ãã¢ã®æ£é¢ç²åŽã¯2次ã®è€éããæã¡ãé床ã«é·ãåäœããŸãã ããã°ã©ã ãå ã®ããŒã¿è¡šçŸãã€ãŸãã·ã§ã€ããã¡ã€ã«ïŒçç±ïŒæŽæ°ãç°¡åã§ãã¡ã³ããã³ã¹ãããã¥ã¡ã³ãåãç¬èªã®ã¹ãã¬ãŒãžåœ¢åŒã®ããŒãžã§ã³åïŒã§çŽæ¥åäœããããšã決å®ãããããå¹ççãªé ç¹èå¥ã¢ã«ãŽãªãºã ãå¿ èŠã§ããã
ãããæãã€ããŸããïŒä»¥äžãC ++ã³ãŒãïŒïŒ
1.ã°ã©ãã®ç«¯ã®ã³ã³ãããäœæããŸããã
typedef size_t EdgeID; typedef size_t VertexID; struct EdgeDesc { VertexID vtxSrc, vtxDest; EdgeInfo info; }; typedef std::unordered_multimap<EdgeID, EdgeDesc> EdgeMap;
ãã«ãããããããã¯ãã°ã©ãã®ã»ã°ã¡ã³ã/ãšããžã«æ°ããèå¥åãå°å ¥ãããåãèå¥åã§åæ¹ããã³åŸæ¹ã®ãšããžã«é¢ããæ å ±ãããããä¿åããããšã決å®ããããã§ãã ç§ã®æèŠã§ã¯ããã€ãã®æé ã®è«çãè€éã«ããŠããã®ã§ãããã¯ããããæ£ãã決å®ã§ã¯ãªãã£ãããæåã¯ãããæ£åžžã§ãããšæãããã
å³1
2.座æšå¹³é¢ã¯ã1ã¡ãŒãã«ãããã®å¹³æ¹ã¡ãŒãã«ã«åå²ãããŸããïŒå³1ïŒã
åé ç¹ã¯ããŒã«é¢é£ä»ããããŠããŸãïŒ
static_assert(sizeof(size_t) >= 8, "size_t type should be 64 bit or larger"); auto keyPartX = [this](double x) { return (size_t)(x - bound_.first.x) + 1; }; auto keyPartY = [this](double y) { return (size_t)(y - bound_.first.y) + 1; }; auto getKey = [](size_t x, size_t y) { return x << (sizeof(size_t) / 2 * 8) | y; }; auto getKeyXY = [&keyPartX, &keyPartY, &getKey](double x, double y) { return getKey(keyPartX(x), keyPartY(y)); };
3.ããã·ã¥ã³ã³ãããŒãäœæããŸãã
typedef size_t CellKey; typedef std::unordered_map<CellKey, std::vector<VertexID>> SPHash;
éè·¯ãããã¯ãŒã¯ã»ã°ã¡ã³ãã®ãªã¹ãã衚瀺ãããšããåæããã³æçµé ç¹ã®èå¥åããšããžã®èå¥åãããã³é¢é£æ å ±ãã€ãŸãå®éã«ã¯é£æ¥ããé ç¹ã®ãªã¹ãã®åœ¢åŒã®ã°ã©ããå«ãèŠçŽ ã®ãªã¹ããäœæããŸãã
ã»ã¯ã·ã§ã³2ã§èšç®ããããŒã䜿çšããŠãã»ã°ã¡ã³ãã®éå§ç¹ãšçµäºç¹ãSPHashã«è¿œå ããããšããŠããŸãã ãã®ãããªããŒãæã€ã³ã³ããã«æ¢ã«ãã€ã³ããããå Žåãæ°ãããã€ã³ããè¿œå ããã®ã§ã¯ãªããæ¢åã®ãã€ã³ãã®èå¥åãè¿ããŸãïŒã³ã³ããå ã®æ¢åã®ãã€ã³ããè¿œå ããããã€ã³ããšåãZã¬ãã«ã«ããå ŽåïŒã
ã³ã³ããã®ããŒã«äœããªãå Žåãã³ã³ããã«ãã€ã³ããå ¥åããè¿œå ããããã€ã³ãã®èå¥åãè¿ããŸãã
çã®ãã€ã³ãïŒ1ã¡ãŒãã«æªæºã®è·é¢ïŒã¯ç°ãªãããŒãæã€ããšãã§ãããããèšç®ãããããŒã ãã§ãªããé£æ¥ãã8ã€ã®ããŒã«ãã£ãŠã³ã³ããããã§ãã¯ããŸãã
std::vector<size_t> near; size_t xPart = keyPartX(px); size_t yPart = keyPartY(py); near.clear(); merge(near, getKey(xPart, yPart)); merge(near, getKey(xPart + 1, yPart)); merge(near, getKey(xPart - 1, yPart)); merge(near, getKey(xPart, yPart + 1)); merge(near, getKey(xPart, yPart - 1)); merge(near, getKey(xPart + 1, yPart + 1)); merge(near, getKey(xPart + 1, yPart - 1)); merge(near, getKey(xPart - 1, yPart + 1)); merge(near, getKey(xPart - 1, yPart - 1));
mergeïŒïŒã¯ãè¿ãã®ãã¯ãã«å ã®æãè¿ãç¹ã®èå¥åããªã¹ãããŸãã
è¿é£ã®èå¥åã®ãªã¹ãïŒå®éã«ã¯ã1ã€ã®é ç¹ã«ããŒãžããåè£ïŒãåãåã£ããããã€ã³ããæ¯èŒãããããã®éã®æ£ç¢ºãªãŠãŒã¯ãªããè·é¢ãèšç®ããŸãã ãããŠãæå®ããããã®ãããå°ããå Žåããã€ã³ãã¯åãã§ãããšä»®å®ãã1ã€ã®é ç¹ã«ããŒãžããŸãïŒå³ã§ã¯åãè²ã§å¡ãã€ã¶ãããŸãïŒãgetKeyããŒïŒxPartãyPartïŒã䜿çšããŠãã»ã«ã«æ¢ã«ããé©åãªé ç¹ã®èå¥åãè¿ããŸãã
æåã¯ããã®åŠçã«ã¯çŽ1ç§ããããŸãã
4.ãã®çµæãç¹å®ã®ãããå€ãããè¿ãã«ããé£æ¥ãã€ã³ãã1ã€ã®èå¥åãåãåãããšãããããŸãã
ããã§ãé£æ¥ããé ç¹ã®ãªã¹ããã§ããŸããã ãã®ãããªãªã¹ããååŸããæéã®è€éãã¯ãé ç¹ã®æ°ã«ç·åœ¢ã«äŸåããŸããããã¯ããããããæ£ç¢ºã«1ååŠçããããã·ã¥ã³ã³ãããŒã§ã®æ€çŽ¢ããã³æ¿å ¥æäœã挞è¿çã«äžå®ã®è€éããæã€ããã§ãã
ãæ°ã¥ãã®ããã«ãããªãŽã³ã¹ããªãŒãã»ã°ã¡ã³ãã®äžéé ç¹ã¯ã°ã©ãããããžã«åœ±é¿ãäžããªããããäžéé ç¹ã¯åŠçããŸããïŒã»ã°ã¡ã³ãã®äžå€®ã§æäœãå®è¡ããããšã¯ã§ããŸããããããã«ããŠããããã«é¢ããããŒã¿ã¯ãããŸããïŒã
ããªã©ã€ã³ãæ§æããã»ã°ã¡ã³ãã«åå²ããåã»ã°ã¡ã³ãããšããžãšèŠãªããšãçŽ140,000ã®ãšããžã®ä»£ããã«ãã°ã©ãã«çŽ600,000ã®ãšããžãæ¢ã«ååšããããšã«ãªããŸãããã¹ã®æ€çŽ¢æéãå€§å¹ ã«å¢å ãããããæçµçã«ãã®å·®ã絶察å€ã§ç€ºããŸãã
æåŸã®ä»äžãããããŸãã å¶éããŸãã¯çŠæ¢ãããæ©åã
å¶éã«ãããããšãã°äº€å·®ç¹ã§å·Šæãããªã©ã®æäœãçŠæ¢ãããŠããŸãã æåã¯ãããŒã¿ã¯é 次移åãçŠæ¢ãããŠããã»ã°ã¡ã³ãã®ãªã¹ãã§ãã
äŸãæããŸãã
å³ 2
èµ€ãç¢å°ã¯çŠæ¢ãããæäœã瀺ããæ°åã¯ã»ã°ã¡ã³ãèå¥åã瀺ããŸãã å®éãããŒã¿ã§ã¯ããã®çŠæ¢ã¯{e1ãe4}ã®ããã«èŠããŸãã
ã«ãŒããæ·èšããããã»ã¹ã§ãã®çŠæ¢ã®è¡šçŸã䜿çšããããšã¯éåžžã«é£ãããããçŠæ¢ãããæ瞊ãã°ã©ãå ã§çŽç²ã«ããããžçã«äžå¯èœã§ãããä»ã®ãã¹ãŠã®èš±å¯ãããæ瞊ãå¯èœã«ãªãããã«ãã°ã©ããããŒã«ã«ã«å€æããããšã«ããŸããã
ãããè¡ãããã«ãçŠæ¢ãããæäœã«å«ãŸããããŒã¯ãè€è£œããŸããã ãããŠãèš±å¯ãããæ瞊ãäœæãããããªæ¹æ³ã§ããããã®è€è£œãããããŒã¯ã«peaks骚ãæããããçŠæ¢ãããæ瞊ã§ã¯ããã®ãããªã«ãŒãã¯åã«äœæã§ããŸããã§ããã
é ç¹ãè€è£œããããšãããã®å¹ŸäœåŠçäœçœ®ã¯åããŸãŸã§ãïŒå³ã«ç€ºãããŠããé ç¹v6ãšv5ã¯å®éã«ã¯åãå Žæã§å¹ŸäœåŠçã§ããã䟿å®äžå³ã®ééã空ããŠããŸãïŒããã¡ãããæ°ããé ç¹ã«æ°ããèå¥åãå²ãåœãŠãããŸãã
äžèšã®çŠæ¢ãããå·Šæã®äº€å·®ç¹ã®äŸã§èšãããããšã説æããŸãã
å³3
ããããžãå€æŽãããã°ã©ãã§ã¯ã亀差ç¹ã§çŠæ¢ããããã¹ã«æ²¿ã£ãŠå·Šæããããšã¯ã§ããªããªããŸãããèš±å¯ããããã¹ãŠã®æäœã¯å¯èœã§ãã
3ã€ä»¥äžã®ãšããžããã®å¶çŽã¯åãåçã«åŸã£ãŠåŠçãããŸãããããå€ãã®æ°ããé ç¹ãšãšããžãçæããŸãããããã®å€æã¯ã°ã©ãã®ãµã€ãºã«åœ±é¿ããŸãããå€§å¹ ã«ã¯åœ±é¿ããŸããïŒãšããžã®æ°ãçŽ5ïŒ å¢å ããŸãïŒã ããŒã¿ã§ã¯ã2ã€ã®ã»ã°ã¡ã³ãããçŽ5000ã®å¶éãããã3ã€ã®ã»ã°ã¡ã³ãããçŽ400ã®å¶éããããŸãã
以äžã¯ã3ã€ã®ãšããžã®å¶çŽã®äœçšäžã§ã°ã©ããã©ã®ããã«å€æããããã瀺ããŠããŸãã
ããã¯ïŒ
å³4
次ã®ããã«ãªããŸããïŒ
å³5ã
ã°ã©ãå€æã¢ã«ãŽãªãºã ã®å®è£ ã¯ããã¹ãŠã®äœæ¥ã®äžã§æãå°é£ãªæ®µéã«ãªãïŒæéã®çŽ30ïŒ ãèŠããïŒããã°ãæãå€ãã£ããšèšããããåŸãŸããã ããã¯ãããŸãããéçºãããŠããªãããŒã¿ã¹ãã¬ãŒãžæ§é ã«äžéšèµ·å ããŸãã ãã®ãããäœããç解ã§ããªããŸãŸã§ããå Žå-æããªããæ¬åœã«ç°¡åã§ã¯ãªãã質åãããçããããšããã
ããŒã«ã«ã€ããŠã
ããã§ãã«ãŒããæ·èšããããšãå¯èœãªãã¹ãŠã®å¶éãèæ ®ããŠã䟿å©ãªåœ¢åŒã§ã°ã©ãã衚瀺ãããŸããã ã¢ã«ãŽãªãºã ãšããŠå€å žçãªãã€ã¯ã¹ãã©ã¢ã«ãŽãªãºã ãè©Šãããšã«ããŸããããã®ã¢ã«ãŽãªãºã ã®å®è£ ã¯ãboostã©ã€ãã©ãªã«ãããŸãã
è¿œå ããããšã¯ããŸããããŸãããããŒã¹ã::ã°ã©ãã«ã¯åªããããã¥ã¡ã³ãããããæžç±ããããŸããäŸã®1ã€ããã³ãŒããåãåºããå°ããªå€æŽãå ããŠäœ¿çšããŸããã
次ã®ã¹ãããã¯ããªã¯ãšã¹ãã®åŠçã§ããã ãµãŒãã¹ãæ¹åãååŸã§ãã座æšã§æå®ãããéå§ç¹ãšçµäºç¹ã®ã¿ãæã€ããšãã§ããã°äŸ¿å©ã ãšå€æããŸããã ãã®ãããã°ã©ãå ã®éå§é ç¹ãšçµäºé ç¹ããã°ããèŠã€ããå¿ èŠããããŸãããããã®é ç¹ã¯ã察å¿ããã¯ãšãªãã€ã³ãã«å¯èœãªéãè¿ãå Žæã«ãããŸãã
ãã®ããã«ã¯ãé路網äžã®ãŠãŒã¶ãŒå®çŸ©ã®ãã€ã³ãã«æãè¿ãå°ç¹ããã°ããèŠã€ããããšãå¿ èŠã§ããïŒãŠãŒã¶ãŒã¯ãéè·¯ãšéè·¯ã®ãããã¯ãŒã¯ã®å€åŽã«ããå°ç¹ããã®ã«ãŒããå¿ èŠãªå ŽåããããŸãïŒã
ããŒã¿å ã®éè·¯-éè·¯ãããã¯ãŒã¯ã®ã»ã°ã¡ã³ãã¯ç Žç·ã§ãããããç Žç·äžã®ç¹å®ã®ãã€ã³ãã«æãè¿ããã€ã³ããèŠã€ããå¿ èŠããããŸãïŒããã¯ãç Žç·äžã«ãããã€ã³ãããŸãã¯ãã®éå§ãŸãã¯çµäºé ç¹ã§ããå¯èœæ§ããããŸãïŒã
ããªãã®æ°ã®ç Žç·ïŒ140,000ïŒã§ããããã°ãã調ã¹ãå¿ èŠããããŸãã ãã¹ãŠã®ã»ã°ã¡ã³ãã®æ€çŽ¢ãé ãããã ããã§ãboost ::ãžãªã¡ããªã©ã€ãã©ãªã®æ°ããããŒãžã§ã³ãå©ãã«ãªããŸãããããã§ã¯ã空éã€ã³ããã¯ã¹ïŒboost ::ãžãªã¡ããª::ã€ã³ããã¯ã¹ïŒããç Žç·ïŒã©ã€ã³ã¹ããªã³ã°ïŒãªã©ã®ãªããžã§ã¯ãããµããŒãããŠãã§ã«ç»å ŽããŠããŸãã
ãã®ã€ã³ããã¯ã¹ã䜿çšããŠãæãè¿ãåè£ããã°ããèŠã€ãããã®äžããæ£ç¢ºãªã¢ã«ãŽãªãºã ãç¹å®ã®ãã€ã³ãã«æãè¿ãã»ã°ã¡ã³ãã決å®ããŸãã
SHPãã¡ã€ã«ã®èªã¿åãã«ã¯GDALã©ã€ãã©ãªã䜿çšããå°ç座æšç³»éã®å€æã«ã¯ïŒéœåžã®ããŒã«ã«ã·ã¹ãã ã§äœæ¥ããŸãããããã¯æŽå²çã«èµ·ãããŸããïŒãproj4ã©ã€ãã©ãªã䜿çšããŠãŠãŒã¶ãŒãGPSïŒWGS84ïŒåº§æšã䜿çšããæ¹ã䟿å©ã§ãã
詳现ã«ã€ããŠã
-rib骚ã®äžå€®ãžã®ã«ãŒã
ã°ã©ãã¯é路網ã®ããããžè¡šçŸã§ããããã€ã¯ã¹ãã©ã¢ã«ãŽãªãºã ãæ©èœããããã®å¹ŸäœåŠçãªè©³çŽ°ã¯éèŠã§ã¯ãªãããšãæãåºããŠãã ããã ãããã幟äœåŠçãªåŽé¢ã¯ãŠãŒã¶ãŒã«ãšã£ãŠéèŠã§ãã ãã€ã¯ã¹ãã©ã®ã¢ã«ãŽãªãºã ã¯ãã°ã©ãã®ç¹å®ã®é ç¹ããä»ã®ãã¹ãŠã®é ç¹ïŒç®çã®çµäºé ç¹ãå«ãïŒãŸã§ã®æçã«ãŒããæ§ç¯ããããšãæãåºããŠãã ããã
ã€ãŸããæåã®é ç¹ã決å®ããå¿ èŠããããŸãããç Žç·ãã€ãŸãå®éã«ã¯ãšããžéã§ã€ã³ããã¯ã¹ã«ããæ€çŽ¢ãå®è¡ããŸãã ã«ãŒãã®ããããã«å¿ èŠãªïŒã°ã©ãå ã®ïŒé ç¹ãç解ããæ¹æ³ãã»ã°ã¡ã³ãã®äžéã®é ç¹ããªããããèŠã€ãã£ãã»ã°ã¡ã³ãã®éå§é ç¹ãŸãã¯çµäºé ç¹ãéžæããå¿ èŠãããããšãæå³ããŸãã
å³6ã
ãããããã®ãããªè§£æ±ºçã¯ããŠãŒã¶ãŒã«ãšã£ãŠã¯äŸ¿å©ã§ã¯ãããŸãããé·ãé«ééè·¯ã§ãæ²ããè§ããããŸããïŒãããŠãããã¯ããèµ·ãããŸãïŒã ãŠãŒã¶ãŒããèªåãå°ããå°ç¹ãã1 kmé¢ããå°ç¹ããã«ãŒããã©ã®ããã«æ§ç¯ãããããèŠãã®ã¯éåžžã«é©ãã§ãããïŒãªããªããæãè¿ãã»ã°ã¡ã³ãã«ã¯ä»ã®ããŒã¯ããªãã£ãããã§ãïŒã ããã¯æªãã§ãã ããã«ãå³6ïŒèµ€ãç Žç·ïŒã«ç€ºãããã«ãã»ã°ã¡ã³ãã®æãè¿ãé ç¹ãéžæãããšãã¿ãŒã²ãããžã®ãã¹ãé·ããªãããšããããŸãããããã¯ãŸã£ããè¯ããããŸããã ãã®ãããã°ã©ãã«é ç¹ãããå€ãååšããããããããé »ç¹ã«é 眮ããããšããäºå®ã®å€èŠ³ãäœããã®æ¹æ³ã§äœæããå¿ èŠããããŸããããããã¯ãã¹æ€çŽ¢ã¢ã«ãŽãªãºã ã®å®è¡æéã«åœ±é¿ãäžããŸããã
å©ç¹ãšæ¬ ç¹ãèæ ®ããŠãããã€ãã®ã¢ãããŒããæ€èšãããŸããã
1ïŒã»ã°ã¡ã³ãã®éå§ããã³çµäºã®äž¡æ¹ã®é ç¹ããã®2åã®æ€çŽ¢ãšãã»ã°ã¡ã³ãã®å¯Ÿå¿ããçµäºããã®ãŠãŒã¶ãŒã®ãã€ã³ãããã®è·é¢ã«å¿ããŠããçããã¹ã®éžæã
ãã©ã¹ïŒå®è£ ãç°¡å
ãã€ãã¹ïŒæçãã¹ãããã«ãµãŒãããŠã察å¿ããåäœæéãé ãããŸãã
2ïŒåé·ã°ã©ãã®äœæïŒé路網ã®ã»ã°ã¡ã³ãã®ãã¹ãŠã®å¹ŸäœåŠçé ç¹ãã°ã©ãã®é ç¹ã«å€ãããŸãã
ãã©ã¹ïŒå®è£ ãç°¡å
çæïŒãã€ã¯ã¹ãã©ã¢ã«ãŽãªãºã ã®äœæ¥æéã®å€§å¹ ãªå¢å ãå Žåã«ãã£ãŠã¯åé¡ã解決ããªãïŒé·ãçŽç·éè·¯åºéïŒ
3ïŒèŠæ±æã«ã°ã©ãã«äžæçãªé ç¹ãšãšããžãè¿œå ããã«ãŒããèŠã€ãã£ãåŸã«ã°ã©ããåæç¶æ ã«æ»ãã
ãã©ã¹ïŒ 1ã€ã®ã«ãŒãæ€çŽ¢ã§ãã°ã©ããèšããŸããå¿ èŠããªããé«éã«åäœããŸãã
ãã€ãã¹ïŒä»ã®æ¹æ³ãããå®è£ ãé£ãã
3çªç®ã®æ¹æ³ãéžæããŸããã å£ããã»ã°ã¡ã³ãäžã«ãããŠãŒã¶ãŒãã€ã³ãã«æãè¿ãé ç¹ãš2ã€ã®ãšããžïŒã»ã°ã¡ã³ããäžæ¹åã®å Žåãéå§ããã³çµäºé ç¹ããŸãã¯ãããã®1ã€ã®ã¿ã«å¯Ÿå¿ããã»ã°ã¡ã³ãã®éšåã«å¯Ÿå¿ïŒãã°ã©ãã«äžæçã«è¿œå ããããããã®é ç¹ãšãšããžãè¿œå ãããŸãã°ã©ãã§ã¯ãæ€çŽ¢ãå®è¡ãããåŸãäžæçãªé ç¹ãšãšããžãã°ã©ãããåé€ãããŸãã
-ãŠã§ãåºå
å®éãç§ãã¡ã®ããã°ã©ã ã¯ãããã¯ãŒã¯ã§ã¯ãŸã£ããæ©èœãããæšæºå ¥åãèªã¿åããåçãæšæºåºåã«æžã蟌ã¿ãŸãããããã¯ãŒã¯ãšãã£ã¹ãããã®ã€ã³ã¿ãŒãã§ãŒã¹å šäœã¯ãnode.jsäžã®å¥åã®ããã°ã©ã ã«ãã£ãŠäœæãããŸãã
-ãã«ãã¹ã¬ãã
ããã§ã¯ãã¹ãŠãç°¡åã§ãã ããã°ã©ã ã¯1ã€ã®ã¹ã¬ããã§å®è¡ãããŸãã ããããæ¬åœã«ãã¹ãŠã®ãµãŒããŒã®ã«ãŒãã«ãããŒãããå¿ èŠãããå Žåã1ã€ã®ããã»ã¹ã§ã°ã©ããä¿åããããã«çŽ300 MBãå¿ èŠã«ãªããããã³ã¢ããšã«1ã€ã®ã€ã³ã¹ã¿ã³ã¹ãå®è¡ã§ããŸãïŒãã®ãµã€ãºã¯2ã3ååæžã§ããŸããããŸã ãã®ã¿ã¹ã¯ãèšå®ããŠããŸããïŒäžèŠãšããŠïŒã ããã»ã¹ããšã«ãªã¯ãšã¹ããé ä¿¡ããæ¹æ³ã¯ïŒ å€éšãã£ã¹ãããã£ããã°ã©ã ãããããããªã¯ãšã¹ãã®åäœããã»ã¹ãžã®é åžãåŠçããããããã©ãŒãã³ã¹ãªã©ãç£èŠãããã§ããŸãã
ãã¹ãŠã®ã³ã¢ãããŒãããããã®å¥ã®ãªãã·ã§ã³ïŒC ++ã§ã®ãã«ãã¹ã¬ããããã°ã©ã ã®äœæã¯ãç§ãã¡ã«ãšã£ãŠã¯ããå°é£ã«æããŸããã ãŸããC ++ã§ãããã¯ãŒã¯ã³ãŒããèšè¿°ããå¿ èŠããããŸãïŒãããžã§ã¯ãã®ã»ãšãã©ã®ãµãŒããŒéšåã¯node.jsã§èšè¿°ãããŠããããããã¯ãŒã¯ã§ã®äœæ¥ãã¯ããã«ç°¡åã§ããããšãããã£ãŠããŸããïŒããŸãã¯å€éšãã£ã¹ãããã£ãŒãžã®ããè€éãªã€ã³ã¿ãŒãã§ã€ã¹ãäœæããŸãstdin / stdoutãšæ¯èŒããŠã 第äºã«ãäžæçãªé ç¹ãšãšããžã®ããã«èªã¿åãå°çšã®ã°ã©ãããããŸãããããã¯ãäžæ¹ã§ããã©ãŒãã³ã¹ãç ç²ã«ãããä»æ¹ã§ãã«ãã¹ã¬ããã³ãŒãã®å¯Ÿå¿ããåé¡ã«ã¶ã€ãããªãããã«ãã¯ãŒã¯ãããŒãéåžžã«æ éã«åæããå¿ èŠãããããšãæå³ããŸããã®æ¹æ³ã§ïŒçŸæç¹ã§ïŒããããå©ç¹ãèŠã€ããŸããã
çµè«ãšããŠãããã€ãã®çµ±èšïŒ
ããã°ã©ã å šäœã¯ãã£ã1,500è¡ã§ãããããã«node.jsã®æ°åè¡ã®ãã£ã¹ãããã£ãŒã1人ãã³ãŒãã£ã³ã°ã«åŸäºããçŽ1ãæããããŸãã+æ°äººã®ååãã¢ã€ãã¢ãšãããã°ãæäŒããŸããã ç§ãã¡ã«ã¯ããã®ãããªæãåºæ¬çãªã¿ã¹ã¯ã§ã¯ãªãããã«æããŸãã
å¹³åã«ãŒãæ€çŽ¢æéïŒCore i7 3.4 Ghzã§ïŒã¯çŽ60ã65ããªç§ã§ãã ã¡ãªã¿ã«ãç Žæããéè·¯ã»ã°ã¡ã³ãã®åã»ã°ã¡ã³ããã°ã©ãã®åå¥ã®ãšããžã«å€ããã°ã©ãäžã®åäœæéã¯çŽ250ããªç§ã§ãããé¡èãªå·®ãããããšã«åæãããšèšããŸãã
æåŸãŸã§èªãã§ããã人ãã¡ã«æ³šç®ããŠãããŠããããšãã