{"algorithm":"k-center","about":["Where should a company open k warehouses so that no address is a long drive from all of them? Trying every choice is far too slow on a city, so path.KCenter chooses them farthest first: it opens the first warehouse, then keeps opening the next one at the address farthest from every warehouse so far. Each new warehouse needs a search only over the addresses it gets closer to, and k rounds cost O(k (V+E) log V).","When every road works both ways in the same time, the longest drive this leaves is never more than twice the best any k warehouses can do. With one-way streets the drives aren't symmetric, and that factor of two isn't guaranteed.","The second warehouse often lands at the edge of the map. The method shrinks the worst drive, so it serves the most remote address first. That is the difference from k-median, which minimizes the average drive and puts warehouses nearer the busy middle.","Warehouses that are already open can be passed as fixed centers. They count toward k and open first, in the order given. Without them, the first center is the first vertex added to the graph. Which one opens first changes the rest."],"template":{"id":"one-way-city","name":"One-way city","description":"Forty-five intersections, I1 to I45, where I stands for intersection, numbered row by row from the top left with nine to a row. Most streets are one way, and the outer streets form a clockwise loop. Only the middle row (I19 to I27) and the middle column (I5, I14, I23, I32 and I41) go both ways, and each edge is the travel time in minutes.","family":"road","directed":true,"weighted":true,"acyclic":false,"vertices":[{"id":"I1","x":64,"y":287},{"id":"I2","x":175,"y":279},{"id":"I3","x":288,"y":275},{"id":"I4","x":381,"y":280},{"id":"I5","x":500,"y":288},{"id":"I6","x":601,"y":274},{"id":"I7","x":715,"y":288},{"id":"I8","x":836,"y":273},{"id":"I9","x":947,"y":289},{"id":"I10","x":58,"y":382},{"id":"I11","x":177,"y":399},{"id":"I12","x":280,"y":398},{"id":"I13","x":395,"y":389},{"id":"I14","x":492,"y":379},{"id":"I15","x":614,"y":383},{"id":"I16","x":720,"y":392},{"id":"I17","x":833,"y":382},{"id":"I18","x":942,"y":384},{"id":"I19","x":55,"y":502},{"id":"I20","x":168,"y":497},{"id":"I21","x":282,"y":490},{"id":"I22","x":393,"y":509},{"id":"I23","x":499,"y":491},{"id":"I24","x":613,"y":508},{"id":"I25","x":714,"y":501},{"id":"I26","x":820,"y":492},{"id":"I27","x":937,"y":502},{"id":"I28","x":67,"y":610},{"id":"I29","x":171,"y":617},{"id":"I30","x":288,"y":600},{"id":"I31","x":392,"y":611},{"id":"I32","x":510,"y":613},{"id":"I33","x":605,"y":600},{"id":"I34","x":725,"y":611},{"id":"I35","x":839,"y":607},{"id":"I36","x":938,"y":605},{"id":"I37","x":56,"y":719},{"id":"I38","x":171,"y":722},{"id":"I39","x":283,"y":728},{"id":"I40","x":391,"y":711},{"id":"I41","x":510,"y":716},{"id":"I42","x":613,"y":724},{"id":"I43","x":715,"y":719},{"id":"I44","x":838,"y":712},{"id":"I45","x":943,"y":720}],"edges":[{"from":"I1","to":"I2","weight":3},{"from":"I10","to":"I1","weight":5},{"from":"I2","to":"I3","weight":2},{"from":"I2","to":"I11","weight":4},{"from":"I3","to":"I4","weight":3},{"from":"I12","to":"I3","weight":4},{"from":"I4","to":"I5","weight":2},{"from":"I4","to":"I13","weight":2},{"from":"I5","to":"I6","weight":5},{"from":"I5","to":"I14","weight":5},{"from":"I14","to":"I5","weight":5},{"from":"I6","to":"I7","weight":4},{"from":"I15","to":"I6","weight":4},{"from":"I7","to":"I8","weight":4},{"from":"I7","to":"I16","weight":3},{"from":"I8","to":"I9","weight":4},{"from":"I17","to":"I8","weight":5},{"from":"I9","to":"I18","weight":2},{"from":"I11","to":"I10","weight":4},{"from":"I19","to":"I10","weight":5},{"from":"I12","to":"I11","weight":5},{"from":"I11","to":"I20","weight":3},{"from":"I13","to":"I12","weight":5},{"from":"I21","to":"I12","weight":2},{"from":"I14","to":"I13","weight":4},{"from":"I13","to":"I22","weight":3},{"from":"I15","to":"I14","weight":2},{"from":"I14","to":"I23","weight":3},{"from":"I23","to":"I14","weight":3},{"from":"I16","to":"I15","weight":2},{"from":"I24","to":"I15","weight":4},{"from":"I17","to":"I16","weight":2},{"from":"I16","to":"I25","weight":2},{"from":"I18","to":"I17","weight":4},{"from":"I26","to":"I17","weight":4},{"from":"I18","to":"I27","weight":5},{"from":"I19","to":"I20","weight":3},{"from":"I20","to":"I19","weight":3},{"from":"I28","to":"I19","weight":4},{"from":"I20","to":"I21","weight":2},{"from":"I21","to":"I20","weight":2},{"from":"I20","to":"I29","weight":3},{"from":"I21","to":"I22","weight":3},{"from":"I22","to":"I21","weight":3},{"from":"I30","to":"I21","weight":3},{"from":"I22","to":"I23","weight":5},{"from":"I23","to":"I22","weight":5},{"from":"I22","to":"I31","weight":2},{"from":"I23","to":"I24","weight":5},{"from":"I24","to":"I23","weight":5},{"from":"I23","to":"I32","weight":5},{"from":"I32","to":"I23","weight":5},{"from":"I24","to":"I25","weight":2},{"from":"I25","to":"I24","weight":2},{"from":"I33","to":"I24","weight":2},{"from":"I25","to":"I26","weight":4},{"from":"I26","to":"I25","weight":4},{"from":"I25","to":"I34","weight":3},{"from":"I26","to":"I27","weight":5},{"from":"I27","to":"I26","weight":5},{"from":"I35","to":"I26","weight":5},{"from":"I27","to":"I36","weight":3},{"from":"I28","to":"I29","weight":3},{"from":"I37","to":"I28","weight":4},{"from":"I29","to":"I30","weight":2},{"from":"I29","to":"I38","weight":4},{"from":"I30","to":"I31","weight":4},{"from":"I39","to":"I30","weight":3},{"from":"I31","to":"I32","weight":5},{"from":"I31","to":"I40","weight":3},{"from":"I32","to":"I33","weight":5},{"from":"I32","to":"I41","weight":4},{"from":"I41","to":"I32","weight":4},{"from":"I33","to":"I34","weight":3},{"from":"I42","to":"I33","weight":2},{"from":"I34","to":"I35","weight":5},{"from":"I34","to":"I43","weight":3},{"from":"I35","to":"I36","weight":5},{"from":"I44","to":"I35","weight":2},{"from":"I36","to":"I45","weight":2},{"from":"I38","to":"I37","weight":3},{"from":"I39","to":"I38","weight":2},{"from":"I40","to":"I39","weight":2},{"from":"I41","to":"I40","weight":2},{"from":"I42","to":"I41","weight":2},{"from":"I43","to":"I42","weight":3},{"from":"I44","to":"I43","weight":5},{"from":"I45","to":"I44","weight":3}],"details":{"vertices":45,"edges":88,"directed":true,"weighted":true,"acyclic":false,"weightMin":2,"weightMax":5,"negativeWeights":false,"density":0.044444444444444446,"inDegree":{"min":1,"avg":1.9555555555555555,"max":4},"outDegree":{"min":1,"avg":1.9555555555555555,"max":4},"selfLoops":0,"components":1}},"problem":"With one warehouse at I23, where should three more open so that the longest drive to any intersection is as short as it can be made?","params":{"k":4,"sources":["I23"]},"result":{"kind":"order","vertices":["I23","I2","I18","I28"]},"answer":"Open warehouses at I23, I2, I18 and I28, in that order. The longest drive is 16.","legend":{"vertex":[{"id":"idle","label":"No warehouse reaches it yet","color":"#64748B","shape":"hollow"},{"id":"waiting","label":"In the queue","color":"#E69F00","shape":"dashed-square"},{"id":"current","label":"Being settled","color":"#56B4E9","shape":"ring"},{"id":"farthest","label":"Farthest from every warehouse","color":"#E69F00","shape":"ring"},{"id":"area-1","label":"Served by warehouse 1","color":"#009E73","shape":"filled"},{"id":"area-2","label":"Served by warehouse 2","color":"#CC79A7","shape":"filled"},{"id":"area-3","label":"Served by warehouse 3","color":"#56B4E9","shape":"filled"},{"id":"area-4","label":"Served by warehouse 4","color":"#D55E00","shape":"filled"},{"id":"center","label":"Warehouse","color":"#F0E442","shape":"filled"}],"edge":[{"id":"idle","label":"Edge","color":"#475569","shape":"line"},{"id":"examined","label":"Checked, not closer","color":"#64748B","shape":"dashed"},{"id":"area-1","label":"Road from warehouse 1","color":"#009E73","shape":"thick"},{"id":"area-2","label":"Road from warehouse 2","color":"#CC79A7","shape":"thick"},{"id":"area-3","label":"Road from warehouse 3","color":"#56B4E9","shape":"thick"},{"id":"area-4","label":"Road from warehouse 4","color":"#D55E00","shape":"thick"}],"panels":[{"id":"order","title":"Warehouses","kind":"list"},{"id":"queue","title":"Priority queue","kind":"list"},{"id":"dist","title":"Drive time","kind":"table"}]},"steps":[{"say":"No warehouse is open yet, so every drive time starts at ∞.","ops":[{"panel":"dist","set":{"I1":"∞"}},{"panel":"dist","set":{"I2":"∞"}},{"panel":"dist","set":{"I3":"∞"}},{"panel":"dist","set":{"I4":"∞"}},{"panel":"dist","set":{"I5":"∞"}},{"panel":"dist","set":{"I6":"∞"}},{"panel":"dist","set":{"I7":"∞"}},{"panel":"dist","set":{"I8":"∞"}},{"panel":"dist","set":{"I9":"∞"}},{"panel":"dist","set":{"I10":"∞"}},{"panel":"dist","set":{"I11":"∞"}},{"panel":"dist","set":{"I12":"∞"}},{"panel":"dist","set":{"I13":"∞"}},{"panel":"dist","set":{"I14":"∞"}},{"panel":"dist","set":{"I15":"∞"}},{"panel":"dist","set":{"I16":"∞"}},{"panel":"dist","set":{"I17":"∞"}},{"panel":"dist","set":{"I18":"∞"}},{"panel":"dist","set":{"I19":"∞"}},{"panel":"dist","set":{"I20":"∞"}},{"panel":"dist","set":{"I21":"∞"}},{"panel":"dist","set":{"I22":"∞"}},{"panel":"dist","set":{"I23":"∞"}},{"panel":"dist","set":{"I24":"∞"}},{"panel":"dist","set":{"I25":"∞"}},{"panel":"dist","set":{"I26":"∞"}},{"panel":"dist","set":{"I27":"∞"}},{"panel":"dist","set":{"I28":"∞"}},{"panel":"dist","set":{"I29":"∞"}},{"panel":"dist","set":{"I30":"∞"}},{"panel":"dist","set":{"I31":"∞"}},{"panel":"dist","set":{"I32":"∞"}},{"panel":"dist","set":{"I33":"∞"}},{"panel":"dist","set":{"I34":"∞"}},{"panel":"dist","set":{"I35":"∞"}},{"panel":"dist","set":{"I36":"∞"}},{"panel":"dist","set":{"I37":"∞"}},{"panel":"dist","set":{"I38":"∞"}},{"panel":"dist","set":{"I39":"∞"}},{"panel":"dist","set":{"I40":"∞"}},{"panel":"dist","set":{"I41":"∞"}},{"panel":"dist","set":{"I42":"∞"}},{"panel":"dist","set":{"I43":"∞"}},{"panel":"dist","set":{"I44":"∞"}},{"panel":"dist","set":{"I45":"∞"}}]},{"say":"Open warehouse 1 at I23, which is given. A search from it gives every place it reaches a drive time. The search goes on to I14, I22, I24 and I32.","ops":[{"v":"I23","state":"center"},{"panel":"dist","set":{"I23":"0"}},{"panel":"order","list":[{"key":"I23"}]},{"e":["I23","I14"],"state":"area-1"},{"v":"I14","state":"waiting"},{"panel":"dist","set":{"I14":"3"}},{"e":["I23","I22"],"state":"area-1"},{"v":"I22","state":"waiting"},{"panel":"dist","set":{"I22":"5"}},{"e":["I23","I24"],"state":"area-1"},{"v":"I24","state":"waiting"},{"panel":"dist","set":{"I24":"5"}},{"e":["I23","I32"],"state":"area-1"},{"v":"I32","state":"waiting"},{"panel":"dist","set":{"I32":"5"}},{"panel":"queue","list":[{"key":"I14","note":"3"},{"key":"I32","note":"5"},{"key":"I24","note":"5"},{"key":"I22","note":"5"}]}]},{"say":"Take I14 from the queue. Warehouse 1 reaches it in 3, and nothing reaches it sooner. The search goes on to I5 and I13.","ops":[{"v":"I14","state":"current"},{"e":["I14","I5"],"state":"area-1"},{"v":"I5","state":"waiting"},{"panel":"dist","set":{"I5":"8"}},{"e":["I14","I13"],"state":"area-1"},{"v":"I13","state":"waiting"},{"panel":"dist","set":{"I13":"7"}},{"panel":"queue","list":[{"key":"I32","note":"5"},{"key":"I22","note":"5"},{"key":"I24","note":"5"},{"key":"I13","note":"7"},{"key":"I5","note":"8"}]}]},{"say":"Take I32 from the queue. Warehouse 1 reaches it in 5, and nothing reaches it sooner. The search goes on to I33 and I41.","ops":[{"v":"I14","state":"area-1"},{"v":"I32","state":"current"},{"e":["I32","I33"],"state":"area-1"},{"v":"I33","state":"waiting"},{"panel":"dist","set":{"I33":"10"}},{"e":["I32","I41"],"state":"area-1"},{"v":"I41","state":"waiting"},{"panel":"dist","set":{"I41":"9"}},{"panel":"queue","list":[{"key":"I22","note":"5"},{"key":"I24","note":"5"},{"key":"I13","note":"7"},{"key":"I5","note":"8"},{"key":"I41","note":"9"},{"key":"I33","note":"10"}]}]},{"say":"Take I22 from the queue. Warehouse 1 reaches it in 5, and nothing reaches it sooner. The search goes on to I21 and I31.","ops":[{"v":"I32","state":"area-1"},{"v":"I22","state":"current"},{"e":["I22","I21"],"state":"area-1"},{"v":"I21","state":"waiting"},{"panel":"dist","set":{"I21":"8"}},{"e":["I22","I31"],"state":"area-1"},{"v":"I31","state":"waiting"},{"panel":"dist","set":{"I31":"7"}},{"panel":"queue","list":[{"key":"I24","note":"5"},{"key":"I13","note":"7"},{"key":"I31","note":"7"},{"key":"I21","note":"8"},{"key":"I5","note":"8"},{"key":"I41","note":"9"},{"key":"I33","note":"10"}]}]},{"say":"Take I24 from the queue. Warehouse 1 reaches it in 5, and nothing reaches it sooner. The search goes on to I15 and I25.","ops":[{"v":"I22","state":"area-1"},{"v":"I24","state":"current"},{"e":["I24","I15"],"state":"area-1"},{"v":"I15","state":"waiting"},{"panel":"dist","set":{"I15":"9"}},{"e":["I24","I25"],"state":"area-1"},{"v":"I25","state":"waiting"},{"panel":"dist","set":{"I25":"7"}},{"panel":"queue","list":[{"key":"I13","note":"7"},{"key":"I25","note":"7"},{"key":"I31","note":"7"},{"key":"I5","note":"8"},{"key":"I21","note":"8"},{"key":"I41","note":"9"},{"key":"I15","note":"9"},{"key":"I33","note":"10"}]}]},{"say":"Take I13 from the queue. Warehouse 1 reaches it in 7, and nothing reaches it sooner. The search goes on to I12.","ops":[{"v":"I24","state":"area-1"},{"v":"I13","state":"current"},{"e":["I13","I12"],"state":"area-1"},{"v":"I12","state":"waiting"},{"panel":"dist","set":{"I12":"12"}},{"panel":"queue","list":[{"key":"I25","note":"7"},{"key":"I31","note":"7"},{"key":"I5","note":"8"},{"key":"I21","note":"8"},{"key":"I15","note":"9"},{"key":"I41","note":"9"},{"key":"I33","note":"10"},{"key":"I12","note":"12"}]}]},{"say":"Take I25 from the queue. Warehouse 1 reaches it in 7, and nothing reaches it sooner. The search goes on to I26 and I34.","ops":[{"v":"I13","state":"area-1"},{"v":"I25","state":"current"},{"e":["I25","I26"],"state":"area-1"},{"v":"I26","state":"waiting"},{"panel":"dist","set":{"I26":"11"}},{"e":["I25","I34"],"state":"area-1"},{"v":"I34","state":"waiting"},{"panel":"dist","set":{"I34":"10"}},{"panel":"queue","list":[{"key":"I31","note":"7"},{"key":"I5","note":"8"},{"key":"I21","note":"8"},{"key":"I15","note":"9"},{"key":"I41","note":"9"},{"key":"I33","note":"10"},{"key":"I34","note":"10"},{"key":"I26","note":"11"},{"key":"I12","note":"12"}]}]},{"say":"Take I31 from the queue. Warehouse 1 reaches it in 7, and nothing reaches it sooner. The search goes on to I40.","ops":[{"v":"I25","state":"area-1"},{"v":"I31","state":"current"},{"e":["I31","I40"],"state":"area-1"},{"v":"I40","state":"waiting"},{"panel":"dist","set":{"I40":"10"}},{"panel":"queue","list":[{"key":"I5","note":"8"},{"key":"I21","note":"8"},{"key":"I41","note":"9"},{"key":"I15","note":"9"},{"key":"I40","note":"10"},{"key":"I33","note":"10"},{"key":"I34","note":"10"},{"key":"I26","note":"11"},{"key":"I12","note":"12"}]}]},{"say":"Take I5 from the queue. Warehouse 1 reaches it in 8, and nothing reaches it sooner. The search goes on to I6.","ops":[{"v":"I31","state":"area-1"},{"v":"I5","state":"current"},{"e":["I5","I6"],"state":"area-1"},{"v":"I6","state":"waiting"},{"panel":"dist","set":{"I6":"13"}},{"panel":"queue","list":[{"key":"I21","note":"8"},{"key":"I41","note":"9"},{"key":"I15","note":"9"},{"key":"I40","note":"10"},{"key":"I34","note":"10"},{"key":"I33","note":"10"},{"key":"I26","note":"11"},{"key":"I12","note":"12"},{"key":"I6","note":"13"}]}]},{"say":"Take I21 from the queue. Warehouse 1 reaches it in 8, and nothing reaches it sooner. The search goes on to I12 and I20.","ops":[{"v":"I5","state":"area-1"},{"v":"I21","state":"current"},{"e":["I13","I12"],"state":"examined"},{"e":["I21","I12"],"state":"area-1"},{"v":"I12","state":"waiting"},{"panel":"dist","set":{"I12":"10"}},{"e":["I21","I20"],"state":"area-1"},{"v":"I20","state":"waiting"},{"panel":"dist","set":{"I20":"10"}},{"panel":"queue","list":[{"key":"I41","note":"9"},{"key":"I15","note":"9"},{"key":"I12","note":"10"},{"key":"I40","note":"10"},{"key":"I34","note":"10"},{"key":"I33","note":"10"},{"key":"I20","note":"10"},{"key":"I26","note":"11"},{"key":"I6","note":"13"}]}]},{"say":"Take I41 from the queue. Warehouse 1 reaches it in 9, and nothing reaches it sooner. I40 already has a drive at least as quick.","ops":[{"v":"I21","state":"area-1"},{"v":"I41","state":"current"},{"e":["I41","I40"],"state":"examined"},{"panel":"queue","list":[{"key":"I15","note":"9"},{"key":"I12","note":"10"},{"key":"I40","note":"10"},{"key":"I34","note":"10"},{"key":"I33","note":"10"},{"key":"I20","note":"10"},{"key":"I26","note":"11"},{"key":"I6","note":"13"}]}]},{"say":"Take I15 from the queue. Warehouse 1 reaches it in 9, and nothing reaches it sooner. I6 already has a drive at least as quick.","ops":[{"v":"I41","state":"area-1"},{"v":"I15","state":"current"},{"e":["I15","I6"],"state":"examined"},{"panel":"queue","list":[{"key":"I12","note":"10"},{"key":"I40","note":"10"},{"key":"I34","note":"10"},{"key":"I33","note":"10"},{"key":"I20","note":"10"},{"key":"I26","note":"11"},{"key":"I6","note":"13"}]}]},{"say":"Take I12 from the queue. Warehouse 1 reaches it in 10, and nothing reaches it sooner. The search goes on to I3 and I11.","ops":[{"v":"I15","state":"area-1"},{"v":"I12","state":"current"},{"e":["I12","I3"],"state":"area-1"},{"v":"I3","state":"waiting"},{"panel":"dist","set":{"I3":"14"}},{"e":["I12","I11"],"state":"area-1"},{"v":"I11","state":"waiting"},{"panel":"dist","set":{"I11":"15"}},{"panel":"queue","list":[{"key":"I40","note":"10"},{"key":"I34","note":"10"},{"key":"I33","note":"10"},{"key":"I20","note":"10"},{"key":"I26","note":"11"},{"key":"I6","note":"13"},{"key":"I3","note":"14"},{"key":"I11","note":"15"}]}]},{"say":"Take I40 from the queue. Warehouse 1 reaches it in 10, and nothing reaches it sooner. The search goes on to I39.","ops":[{"v":"I12","state":"area-1"},{"v":"I40","state":"current"},{"e":["I40","I39"],"state":"area-1"},{"v":"I39","state":"waiting"},{"panel":"dist","set":{"I39":"12"}},{"panel":"queue","list":[{"key":"I34","note":"10"},{"key":"I33","note":"10"},{"key":"I20","note":"10"},{"key":"I26","note":"11"},{"key":"I39","note":"12"},{"key":"I6","note":"13"},{"key":"I3","note":"14"},{"key":"I11","note":"15"}]}]},{"say":"Take I34 from the queue. Warehouse 1 reaches it in 10, and nothing reaches it sooner. The search goes on to I35 and I43.","ops":[{"v":"I40","state":"area-1"},{"v":"I34","state":"current"},{"e":["I34","I35"],"state":"area-1"},{"v":"I35","state":"waiting"},{"panel":"dist","set":{"I35":"15"}},{"e":["I34","I43"],"state":"area-1"},{"v":"I43","state":"waiting"},{"panel":"dist","set":{"I43":"13"}},{"panel":"queue","list":[{"key":"I33","note":"10"},{"key":"I20","note":"10"},{"key":"I26","note":"11"},{"key":"I39","note":"12"},{"key":"I43","note":"13"},{"key":"I6","note":"13"},{"key":"I3","note":"14"},{"key":"I35","note":"15"},{"key":"I11","note":"15"}]}]},{"say":"Take I33 from the queue. Warehouse 1 reaches it in 10, and nothing reaches it sooner. It has no neighbor left to check.","ops":[{"v":"I34","state":"area-1"},{"v":"I33","state":"current"},{"panel":"queue","list":[{"key":"I20","note":"10"},{"key":"I26","note":"11"},{"key":"I39","note":"12"},{"key":"I43","note":"13"},{"key":"I6","note":"13"},{"key":"I3","note":"14"},{"key":"I35","note":"15"},{"key":"I11","note":"15"}]}]},{"say":"Take I20 from the queue. Warehouse 1 reaches it in 10, and nothing reaches it sooner. The search goes on to I19 and I29.","ops":[{"v":"I33","state":"area-1"},{"v":"I20","state":"current"},{"e":["I20","I19"],"state":"area-1"},{"v":"I19","state":"waiting"},{"panel":"dist","set":{"I19":"13"}},{"e":["I20","I29"],"state":"area-1"},{"v":"I29","state":"waiting"},{"panel":"dist","set":{"I29":"13"}},{"panel":"queue","list":[{"key":"I26","note":"11"},{"key":"I39","note":"12"},{"key":"I29","note":"13"},{"key":"I19","note":"13"},{"key":"I43","note":"13"},{"key":"I6","note":"13"},{"key":"I3","note":"14"},{"key":"I11","note":"15"},{"key":"I35","note":"15"}]}]},{"say":"Take I26 from the queue. Warehouse 1 reaches it in 11, and nothing reaches it sooner. The search goes on to I17 and I27.","ops":[{"v":"I20","state":"area-1"},{"v":"I26","state":"current"},{"e":["I26","I17"],"state":"area-1"},{"v":"I17","state":"waiting"},{"panel":"dist","set":{"I17":"15"}},{"e":["I26","I27"],"state":"area-1"},{"v":"I27","state":"waiting"},{"panel":"dist","set":{"I27":"16"}},{"panel":"queue","list":[{"key":"I39","note":"12"},{"key":"I29","note":"13"},{"key":"I19","note":"13"},{"key":"I43","note":"13"},{"key":"I6","note":"13"},{"key":"I3","note":"14"},{"key":"I17","note":"15"},{"key":"I35","note":"15"},{"key":"I11","note":"15"},{"key":"I27","note":"16"}]}]},{"say":"Take I39 from the queue. Warehouse 1 reaches it in 12, and nothing reaches it sooner. The search goes on to I30 and I38.","ops":[{"v":"I26","state":"area-1"},{"v":"I39","state":"current"},{"e":["I39","I30"],"state":"area-1"},{"v":"I30","state":"waiting"},{"panel":"dist","set":{"I30":"15"}},{"e":["I39","I38"],"state":"area-1"},{"v":"I38","state":"waiting"},{"panel":"dist","set":{"I38":"14"}},{"panel":"queue","list":[{"key":"I29","note":"13"},{"key":"I19","note":"13"},{"key":"I43","note":"13"},{"key":"I6","note":"13"},{"key":"I3","note":"14"},{"key":"I38","note":"14"},{"key":"I35","note":"15"},{"key":"I30","note":"15"},{"key":"I17","note":"15"},{"key":"I11","note":"15"},{"key":"I27","note":"16"}]}]},{"say":"Take I29 from the queue. Warehouse 1 reaches it in 13, and nothing reaches it sooner. I30 and I38 already have a drive at least as quick.","ops":[{"v":"I39","state":"area-1"},{"v":"I29","state":"current"},{"e":["I29","I30"],"state":"examined"},{"e":["I29","I38"],"state":"examined"},{"panel":"queue","list":[{"key":"I19","note":"13"},{"key":"I43","note":"13"},{"key":"I6","note":"13"},{"key":"I3","note":"14"},{"key":"I38","note":"14"},{"key":"I35","note":"15"},{"key":"I30","note":"15"},{"key":"I17","note":"15"},{"key":"I11","note":"15"},{"key":"I27","note":"16"}]}]},{"say":"Take I19 from the queue. Warehouse 1 reaches it in 13, and nothing reaches it sooner. The search goes on to I10.","ops":[{"v":"I29","state":"area-1"},{"v":"I19","state":"current"},{"e":["I19","I10"],"state":"area-1"},{"v":"I10","state":"waiting"},{"panel":"dist","set":{"I10":"18"}},{"panel":"queue","list":[{"key":"I43","note":"13"},{"key":"I6","note":"13"},{"key":"I3","note":"14"},{"key":"I38","note":"14"},{"key":"I11","note":"15"},{"key":"I17","note":"15"},{"key":"I30","note":"15"},{"key":"I35","note":"15"},{"key":"I27","note":"16"},{"key":"I10","note":"18"}]}]},{"say":"Take I43 from the queue. Warehouse 1 reaches it in 13, and nothing reaches it sooner. The search goes on to I42.","ops":[{"v":"I19","state":"area-1"},{"v":"I43","state":"current"},{"e":["I43","I42"],"state":"area-1"},{"v":"I42","state":"waiting"},{"panel":"dist","set":{"I42":"16"}},{"panel":"queue","list":[{"key":"I6","note":"13"},{"key":"I3","note":"14"},{"key":"I38","note":"14"},{"key":"I17","note":"15"},{"key":"I35","note":"15"},{"key":"I30","note":"15"},{"key":"I11","note":"15"},{"key":"I42","note":"16"},{"key":"I27","note":"16"},{"key":"I10","note":"18"}]}]},{"say":"Take I6 from the queue. Warehouse 1 reaches it in 13, and nothing reaches it sooner. The search goes on to I7.","ops":[{"v":"I43","state":"area-1"},{"v":"I6","state":"current"},{"e":["I6","I7"],"state":"area-1"},{"v":"I7","state":"waiting"},{"panel":"dist","set":{"I7":"17"}},{"panel":"queue","list":[{"key":"I3","note":"14"},{"key":"I38","note":"14"},{"key":"I11","note":"15"},{"key":"I17","note":"15"},{"key":"I35","note":"15"},{"key":"I30","note":"15"},{"key":"I42","note":"16"},{"key":"I27","note":"16"},{"key":"I7","note":"17"},{"key":"I10","note":"18"}]}]},{"say":"Take I3 from the queue. Warehouse 1 reaches it in 14, and nothing reaches it sooner. The search goes on to I4.","ops":[{"v":"I6","state":"area-1"},{"v":"I3","state":"current"},{"e":["I3","I4"],"state":"area-1"},{"v":"I4","state":"waiting"},{"panel":"dist","set":{"I4":"17"}},{"panel":"queue","list":[{"key":"I38","note":"14"},{"key":"I17","note":"15"},{"key":"I35","note":"15"},{"key":"I11","note":"15"},{"key":"I30","note":"15"},{"key":"I42","note":"16"},{"key":"I27","note":"16"},{"key":"I7","note":"17"},{"key":"I4","note":"17"},{"key":"I10","note":"18"}]}]},{"say":"Take I38 from the queue. Warehouse 1 reaches it in 14, and nothing reaches it sooner. The search goes on to I37.","ops":[{"v":"I3","state":"area-1"},{"v":"I38","state":"current"},{"e":["I38","I37"],"state":"area-1"},{"v":"I37","state":"waiting"},{"panel":"dist","set":{"I37":"17"}},{"panel":"queue","list":[{"key":"I17","note":"15"},{"key":"I35","note":"15"},{"key":"I11","note":"15"},{"key":"I30","note":"15"},{"key":"I42","note":"16"},{"key":"I27","note":"16"},{"key":"I4","note":"17"},{"key":"I37","note":"17"},{"key":"I7","note":"17"},{"key":"I10","note":"18"}]}]},{"say":"Take I17 from the queue. Warehouse 1 reaches it in 15, and nothing reaches it sooner. The search goes on to I8 and I16.","ops":[{"v":"I38","state":"area-1"},{"v":"I17","state":"current"},{"e":["I17","I8"],"state":"area-1"},{"v":"I8","state":"waiting"},{"panel":"dist","set":{"I8":"20"}},{"e":["I17","I16"],"state":"area-1"},{"v":"I16","state":"waiting"},{"panel":"dist","set":{"I16":"17"}},{"panel":"queue","list":[{"key":"I35","note":"15"},{"key":"I11","note":"15"},{"key":"I30","note":"15"},{"key":"I42","note":"16"},{"key":"I27","note":"16"},{"key":"I4","note":"17"},{"key":"I37","note":"17"},{"key":"I16","note":"17"},{"key":"I7","note":"17"},{"key":"I10","note":"18"},{"key":"I8","note":"20"}]}]},{"say":"Take I35 from the queue. Warehouse 1 reaches it in 15, and nothing reaches it sooner. The search goes on to I36.","ops":[{"v":"I17","state":"area-1"},{"v":"I35","state":"current"},{"e":["I35","I36"],"state":"area-1"},{"v":"I36","state":"waiting"},{"panel":"dist","set":{"I36":"20"}},{"panel":"queue","list":[{"key":"I11","note":"15"},{"key":"I30","note":"15"},{"key":"I42","note":"16"},{"key":"I27","note":"16"},{"key":"I37","note":"17"},{"key":"I4","note":"17"},{"key":"I16","note":"17"},{"key":"I7","note":"17"},{"key":"I10","note":"18"},{"key":"I8","note":"20"},{"key":"I36","note":"20"}]}]},{"say":"Take I11 from the queue. Warehouse 1 reaches it in 15, and nothing reaches it sooner. I10 already has a drive at least as quick.","ops":[{"v":"I35","state":"area-1"},{"v":"I11","state":"current"},{"e":["I11","I10"],"state":"examined"},{"panel":"queue","list":[{"key":"I30","note":"15"},{"key":"I42","note":"16"},{"key":"I27","note":"16"},{"key":"I37","note":"17"},{"key":"I4","note":"17"},{"key":"I16","note":"17"},{"key":"I7","note":"17"},{"key":"I10","note":"18"},{"key":"I8","note":"20"},{"key":"I36","note":"20"}]}]},{"say":"Take I30 from the queue. Warehouse 1 reaches it in 15, and nothing reaches it sooner. It has no neighbor left to check.","ops":[{"v":"I11","state":"area-1"},{"v":"I30","state":"current"},{"panel":"queue","list":[{"key":"I42","note":"16"},{"key":"I27","note":"16"},{"key":"I37","note":"17"},{"key":"I4","note":"17"},{"key":"I16","note":"17"},{"key":"I7","note":"17"},{"key":"I10","note":"18"},{"key":"I8","note":"20"},{"key":"I36","note":"20"}]}]},{"say":"Take I42 from the queue. Warehouse 1 reaches it in 16, and nothing reaches it sooner. It has no neighbor left to check.","ops":[{"v":"I30","state":"area-1"},{"v":"I42","state":"current"},{"panel":"queue","list":[{"key":"I27","note":"16"},{"key":"I37","note":"17"},{"key":"I4","note":"17"},{"key":"I16","note":"17"},{"key":"I7","note":"17"},{"key":"I10","note":"18"},{"key":"I8","note":"20"},{"key":"I36","note":"20"}]}]},{"say":"Take I27 from the queue. Warehouse 1 reaches it in 16, and nothing reaches it sooner. The search goes on to I36.","ops":[{"v":"I42","state":"area-1"},{"v":"I27","state":"current"},{"e":["I35","I36"],"state":"examined"},{"e":["I27","I36"],"state":"area-1"},{"v":"I36","state":"waiting"},{"panel":"dist","set":{"I36":"19"}},{"panel":"queue","list":[{"key":"I37","note":"17"},{"key":"I4","note":"17"},{"key":"I16","note":"17"},{"key":"I7","note":"17"},{"key":"I10","note":"18"},{"key":"I36","note":"19"},{"key":"I8","note":"20"}]}]},{"say":"Take I37 from the queue. Warehouse 1 reaches it in 17, and nothing reaches it sooner. The search goes on to I28.","ops":[{"v":"I27","state":"area-1"},{"v":"I37","state":"current"},{"e":["I37","I28"],"state":"area-1"},{"v":"I28","state":"waiting"},{"panel":"dist","set":{"I28":"21"}},{"panel":"queue","list":[{"key":"I4","note":"17"},{"key":"I16","note":"17"},{"key":"I7","note":"17"},{"key":"I10","note":"18"},{"key":"I36","note":"19"},{"key":"I8","note":"20"},{"key":"I28","note":"21"}]}]},{"say":"Take I4 from the queue. Warehouse 1 reaches it in 17, and nothing reaches it sooner. It has no neighbor left to check.","ops":[{"v":"I37","state":"area-1"},{"v":"I4","state":"current"},{"panel":"queue","list":[{"key":"I16","note":"17"},{"key":"I7","note":"17"},{"key":"I10","note":"18"},{"key":"I36","note":"19"},{"key":"I8","note":"20"},{"key":"I28","note":"21"}]}]},{"say":"Take I16 from the queue. Warehouse 1 reaches it in 17, and nothing reaches it sooner. It has no neighbor left to check.","ops":[{"v":"I4","state":"area-1"},{"v":"I16","state":"current"},{"panel":"queue","list":[{"key":"I7","note":"17"},{"key":"I10","note":"18"},{"key":"I36","note":"19"},{"key":"I8","note":"20"},{"key":"I28","note":"21"}]}]},{"say":"Take I7 from the queue. Warehouse 1 reaches it in 17, and nothing reaches it sooner. I8 already has a drive at least as quick.","ops":[{"v":"I16","state":"area-1"},{"v":"I7","state":"current"},{"e":["I7","I8"],"state":"examined"},{"panel":"queue","list":[{"key":"I10","note":"18"},{"key":"I36","note":"19"},{"key":"I8","note":"20"},{"key":"I28","note":"21"}]}]},{"say":"Take I10 from the queue. Warehouse 1 reaches it in 18, and nothing reaches it sooner. The search goes on to I1.","ops":[{"v":"I7","state":"area-1"},{"v":"I10","state":"current"},{"e":["I10","I1"],"state":"area-1"},{"v":"I1","state":"waiting"},{"panel":"dist","set":{"I1":"23"}},{"panel":"queue","list":[{"key":"I36","note":"19"},{"key":"I8","note":"20"},{"key":"I28","note":"21"},{"key":"I1","note":"23"}]}]},{"say":"Take I36 from the queue. Warehouse 1 reaches it in 19, and nothing reaches it sooner. The search goes on to I45.","ops":[{"v":"I10","state":"area-1"},{"v":"I36","state":"current"},{"e":["I36","I45"],"state":"area-1"},{"v":"I45","state":"waiting"},{"panel":"dist","set":{"I45":"21"}},{"panel":"queue","list":[{"key":"I8","note":"20"},{"key":"I28","note":"21"},{"key":"I45","note":"21"},{"key":"I1","note":"23"}]}]},{"say":"Take I8 from the queue. Warehouse 1 reaches it in 20, and nothing reaches it sooner. The search goes on to I9.","ops":[{"v":"I36","state":"area-1"},{"v":"I8","state":"current"},{"e":["I8","I9"],"state":"area-1"},{"v":"I9","state":"waiting"},{"panel":"dist","set":{"I9":"24"}},{"panel":"queue","list":[{"key":"I28","note":"21"},{"key":"I45","note":"21"},{"key":"I1","note":"23"},{"key":"I9","note":"24"}]}]},{"say":"Take I28 from the queue. Warehouse 1 reaches it in 21, and nothing reaches it sooner. It has no neighbor left to check.","ops":[{"v":"I8","state":"area-1"},{"v":"I28","state":"current"},{"panel":"queue","list":[{"key":"I45","note":"21"},{"key":"I1","note":"23"},{"key":"I9","note":"24"}]}]},{"say":"Take I45 from the queue. Warehouse 1 reaches it in 21, and nothing reaches it sooner. The search goes on to I44.","ops":[{"v":"I28","state":"area-1"},{"v":"I45","state":"current"},{"e":["I45","I44"],"state":"area-1"},{"v":"I44","state":"waiting"},{"panel":"dist","set":{"I44":"24"}},{"panel":"queue","list":[{"key":"I1","note":"23"},{"key":"I44","note":"24"},{"key":"I9","note":"24"}]}]},{"say":"Take I1 from the queue. Warehouse 1 reaches it in 23, and nothing reaches it sooner. The search goes on to I2.","ops":[{"v":"I45","state":"area-1"},{"v":"I1","state":"current"},{"e":["I1","I2"],"state":"area-1"},{"v":"I2","state":"waiting"},{"panel":"dist","set":{"I2":"26"}},{"panel":"queue","list":[{"key":"I44","note":"24"},{"key":"I9","note":"24"},{"key":"I2","note":"26"}]}]},{"say":"Take I44 from the queue. Warehouse 1 reaches it in 24, and nothing reaches it sooner. It has no neighbor left to check.","ops":[{"v":"I1","state":"area-1"},{"v":"I44","state":"current"},{"panel":"queue","list":[{"key":"I9","note":"24"},{"key":"I2","note":"26"}]}]},{"say":"Take I9 from the queue. Warehouse 1 reaches it in 24, and nothing reaches it sooner. The search goes on to I18.","ops":[{"v":"I44","state":"area-1"},{"v":"I9","state":"current"},{"e":["I9","I18"],"state":"area-1"},{"v":"I18","state":"waiting"},{"panel":"dist","set":{"I18":"26"}},{"panel":"queue","list":[{"key":"I2","note":"26"},{"key":"I18","note":"26"}]}]},{"say":"Take I2 from the queue. Warehouse 1 reaches it in 26, and nothing reaches it sooner. It has no neighbor left to check.","ops":[{"v":"I9","state":"area-1"},{"v":"I2","state":"current"},{"panel":"queue","list":[{"key":"I18","note":"26"}]}]},{"say":"Take I18 from the queue. Warehouse 1 reaches it in 26, and nothing reaches it sooner. It has no neighbor left to check.","ops":[{"v":"I2","state":"area-1"},{"v":"I18","state":"current"},{"panel":"queue","list":[]}]},{"say":"Warehouse 1's search is done. The farthest place from every warehouse is I2, 26 from warehouse 1, so warehouse 2 opens there next.","ops":[{"v":"I18","state":"area-1"},{"v":"I2","state":"farthest"}]},{"say":"Open warehouse 2 at I2, which was 26 from warehouse 1. A search from it goes on only while it gets closer than the drive a place already has. The search goes on to I3 and I11.","ops":[{"e":["I11","I10"],"state":"idle"},{"e":["I13","I12"],"state":"idle"},{"e":["I15","I6"],"state":"idle"},{"e":["I29","I30"],"state":"idle"},{"e":["I29","I38"],"state":"idle"},{"e":["I35","I36"],"state":"idle"},{"e":["I41","I40"],"state":"idle"},{"e":["I7","I8"],"state":"idle"},{"e":["I1","I2"],"state":"idle"},{"v":"I2","state":"center"},{"panel":"dist","set":{"I2":"0"}},{"panel":"order","list":[{"key":"I23"},{"key":"I2"}]},{"e":["I12","I3"],"state":"idle"},{"e":["I2","I3"],"state":"area-2"},{"v":"I3","state":"waiting"},{"panel":"dist","set":{"I3":"2"}},{"e":["I12","I11"],"state":"idle"},{"e":["I2","I11"],"state":"area-2"},{"v":"I11","state":"waiting"},{"panel":"dist","set":{"I11":"4"}},{"panel":"queue","list":[{"key":"I3","note":"2"},{"key":"I11","note":"4"}]}]},{"say":"Take I3 from the queue. Warehouse 2 reaches it in 2, closer than 14 from warehouse 1. The search goes on to I4.","ops":[{"v":"I3","state":"current"},{"e":["I3","I4"],"state":"idle"},{"e":["I3","I4"],"state":"area-2"},{"v":"I4","state":"waiting"},{"panel":"dist","set":{"I4":"5"}},{"panel":"queue","list":[{"key":"I11","note":"4"},{"key":"I4","note":"5"}]}]},{"say":"Take I11 from the queue. Warehouse 2 reaches it in 4, closer than 15 from warehouse 1. The search goes on to I10 and I20.","ops":[{"v":"I3","state":"area-2"},{"v":"I11","state":"current"},{"e":["I19","I10"],"state":"idle"},{"e":["I11","I10"],"state":"area-2"},{"v":"I10","state":"waiting"},{"panel":"dist","set":{"I10":"8"}},{"e":["I21","I20"],"state":"idle"},{"e":["I11","I20"],"state":"area-2"},{"v":"I20","state":"waiting"},{"panel":"dist","set":{"I20":"7"}},{"panel":"queue","list":[{"key":"I4","note":"5"},{"key":"I20","note":"7"},{"key":"I10","note":"8"}]}]},{"say":"Take I4 from the queue. Warehouse 2 reaches it in 5, closer than 17 from warehouse 1. The search goes on to I5. I13 stays with warehouse 1, which is at least as near.","ops":[{"v":"I11","state":"area-2"},{"v":"I4","state":"current"},{"e":["I4","I13"],"state":"examined"},{"e":["I14","I5"],"state":"idle"},{"e":["I4","I5"],"state":"area-2"},{"v":"I5","state":"waiting"},{"panel":"dist","set":{"I5":"7"}},{"panel":"queue","list":[{"key":"I20","note":"7"},{"key":"I5","note":"7"},{"key":"I10","note":"8"}]}]},{"say":"Take I20 from the queue. Warehouse 2 reaches it in 7, closer than 10 from warehouse 1. The search goes on to I19 and I29. I21 stays with warehouse 1, which is nearer.","ops":[{"v":"I4","state":"area-2"},{"v":"I20","state":"current"},{"e":["I20","I21"],"state":"examined"},{"e":["I20","I19"],"state":"idle"},{"e":["I20","I19"],"state":"area-2"},{"v":"I19","state":"waiting"},{"panel":"dist","set":{"I19":"10"}},{"e":["I20","I29"],"state":"idle"},{"e":["I20","I29"],"state":"area-2"},{"v":"I29","state":"waiting"},{"panel":"dist","set":{"I29":"10"}},{"panel":"queue","list":[{"key":"I5","note":"7"},{"key":"I10","note":"8"},{"key":"I19","note":"10"},{"key":"I29","note":"10"}]}]},{"say":"Take I5 from the queue. Warehouse 2 reaches it in 7, closer than 8 from warehouse 1. The search goes on to I6. I14 stays with warehouse 1, which is nearer.","ops":[{"v":"I20","state":"area-2"},{"v":"I5","state":"current"},{"e":["I5","I14"],"state":"examined"},{"e":["I5","I6"],"state":"idle"},{"e":["I5","I6"],"state":"area-2"},{"v":"I6","state":"waiting"},{"panel":"dist","set":{"I6":"12"}},{"panel":"queue","list":[{"key":"I10","note":"8"},{"key":"I29","note":"10"},{"key":"I19","note":"10"},{"key":"I6","note":"12"}]}]},{"say":"Take I10 from the queue. Warehouse 2 reaches it in 8, closer than 18 from warehouse 1. The search goes on to I1.","ops":[{"v":"I5","state":"area-2"},{"v":"I10","state":"current"},{"e":["I10","I1"],"state":"idle"},{"e":["I10","I1"],"state":"area-2"},{"v":"I1","state":"waiting"},{"panel":"dist","set":{"I1":"13"}},{"panel":"queue","list":[{"key":"I29","note":"10"},{"key":"I19","note":"10"},{"key":"I6","note":"12"},{"key":"I1","note":"13"}]}]},{"say":"Take I29 from the queue. Warehouse 2 reaches it in 10, closer than 13 from warehouse 1. The search goes on to I30. I38 stays with warehouse 1, which is at least as near.","ops":[{"v":"I10","state":"area-2"},{"v":"I29","state":"current"},{"e":["I29","I38"],"state":"examined"},{"e":["I39","I30"],"state":"idle"},{"e":["I29","I30"],"state":"area-2"},{"v":"I30","state":"waiting"},{"panel":"dist","set":{"I30":"12"}},{"panel":"queue","list":[{"key":"I19","note":"10"},{"key":"I30","note":"12"},{"key":"I6","note":"12"},{"key":"I1","note":"13"}]}]},{"say":"Take I19 from the queue. Warehouse 2 reaches it in 10, closer than 13 from warehouse 1. It has no neighbor left to check.","ops":[{"v":"I29","state":"area-2"},{"v":"I19","state":"current"},{"panel":"queue","list":[{"key":"I30","note":"12"},{"key":"I6","note":"12"},{"key":"I1","note":"13"}]}]},{"say":"Take I30 from the queue. Warehouse 2 reaches it in 12, closer than 15 from warehouse 1. I21 and I31 stay with warehouse 1, which is nearer.","ops":[{"v":"I19","state":"area-2"},{"v":"I30","state":"current"},{"e":["I30","I21"],"state":"examined"},{"e":["I30","I31"],"state":"examined"},{"panel":"queue","list":[{"key":"I6","note":"12"},{"key":"I1","note":"13"}]}]},{"say":"Take I6 from the queue. Warehouse 2 reaches it in 12, closer than 13 from warehouse 1. The search goes on to I7.","ops":[{"v":"I30","state":"area-2"},{"v":"I6","state":"current"},{"e":["I6","I7"],"state":"idle"},{"e":["I6","I7"],"state":"area-2"},{"v":"I7","state":"waiting"},{"panel":"dist","set":{"I7":"16"}},{"panel":"queue","list":[{"key":"I1","note":"13"},{"key":"I7","note":"16"}]}]},{"say":"Take I1 from the queue. Warehouse 2 reaches it in 13, closer than 23 from warehouse 1. It has no neighbor left to check.","ops":[{"v":"I6","state":"area-2"},{"v":"I1","state":"current"},{"panel":"queue","list":[{"key":"I7","note":"16"}]}]},{"say":"Take I7 from the queue. Warehouse 2 reaches it in 16, closer than 17 from warehouse 1. I8 and I16 stay with warehouse 1, which is at least as near.","ops":[{"v":"I1","state":"area-2"},{"v":"I7","state":"current"},{"e":["I7","I8"],"state":"examined"},{"e":["I7","I16"],"state":"examined"},{"panel":"queue","list":[]}]},{"say":"Warehouse 2's search is done. 12 places moved to it. The farthest place from every warehouse is I18, 26 from warehouse 1, so warehouse 3 opens there next.","ops":[{"v":"I7","state":"area-2"},{"v":"I18","state":"farthest"}]},{"say":"Open warehouse 3 at I18, which was 26 from warehouse 1. A search from it goes on only while it gets closer than the drive a place already has. The search goes on to I17 and I27.","ops":[{"e":["I20","I21"],"state":"idle"},{"e":["I29","I38"],"state":"idle"},{"e":["I30","I21"],"state":"idle"},{"e":["I30","I31"],"state":"idle"},{"e":["I4","I13"],"state":"idle"},{"e":["I5","I14"],"state":"idle"},{"e":["I7","I16"],"state":"idle"},{"e":["I7","I8"],"state":"idle"},{"e":["I9","I18"],"state":"idle"},{"v":"I18","state":"center"},{"panel":"dist","set":{"I18":"0"}},{"panel":"order","list":[{"key":"I23"},{"key":"I2"},{"key":"I18"}]},{"e":["I26","I17"],"state":"idle"},{"e":["I18","I17"],"state":"area-3"},{"v":"I17","state":"waiting"},{"panel":"dist","set":{"I17":"4"}},{"e":["I26","I27"],"state":"idle"},{"e":["I18","I27"],"state":"area-3"},{"v":"I27","state":"waiting"},{"panel":"dist","set":{"I27":"5"}},{"panel":"queue","list":[{"key":"I17","note":"4"},{"key":"I27","note":"5"}]}]},{"say":"Take I17 from the queue. Warehouse 3 reaches it in 4, closer than 15 from warehouse 1. The search goes on to I8 and I16.","ops":[{"v":"I17","state":"current"},{"e":["I17","I8"],"state":"idle"},{"e":["I17","I8"],"state":"area-3"},{"v":"I8","state":"waiting"},{"panel":"dist","set":{"I8":"9"}},{"e":["I17","I16"],"state":"idle"},{"e":["I17","I16"],"state":"area-3"},{"v":"I16","state":"waiting"},{"panel":"dist","set":{"I16":"6"}},{"panel":"queue","list":[{"key":"I27","note":"5"},{"key":"I16","note":"6"},{"key":"I8","note":"9"}]}]},{"say":"Take I27 from the queue. Warehouse 3 reaches it in 5, closer than 16 from warehouse 1. The search goes on to I26 and I36.","ops":[{"v":"I17","state":"area-3"},{"v":"I27","state":"current"},{"e":["I25","I26"],"state":"idle"},{"e":["I27","I26"],"state":"area-3"},{"v":"I26","state":"waiting"},{"panel":"dist","set":{"I26":"10"}},{"e":["I27","I36"],"state":"idle"},{"e":["I27","I36"],"state":"area-3"},{"v":"I36","state":"waiting"},{"panel":"dist","set":{"I36":"8"}},{"panel":"queue","list":[{"key":"I16","note":"6"},{"key":"I36","note":"8"},{"key":"I8","note":"9"},{"key":"I26","note":"10"}]}]},{"say":"Take I16 from the queue. Warehouse 3 reaches it in 6, closer than 17 from warehouse 1. The search goes on to I15. I25 stays with warehouse 1, which is nearer.","ops":[{"v":"I27","state":"area-3"},{"v":"I16","state":"current"},{"e":["I16","I25"],"state":"examined"},{"e":["I24","I15"],"state":"idle"},{"e":["I16","I15"],"state":"area-3"},{"v":"I15","state":"waiting"},{"panel":"dist","set":{"I15":"8"}},{"panel":"queue","list":[{"key":"I36","note":"8"},{"key":"I15","note":"8"},{"key":"I8","note":"9"},{"key":"I26","note":"10"}]}]},{"say":"Take I36 from the queue. Warehouse 3 reaches it in 8, closer than 19 from warehouse 1. The search goes on to I45.","ops":[{"v":"I16","state":"area-3"},{"v":"I36","state":"current"},{"e":["I36","I45"],"state":"idle"},{"e":["I36","I45"],"state":"area-3"},{"v":"I45","state":"waiting"},{"panel":"dist","set":{"I45":"10"}},{"panel":"queue","list":[{"key":"I15","note":"8"},{"key":"I8","note":"9"},{"key":"I26","note":"10"},{"key":"I45","note":"10"}]}]},{"say":"Take I15 from the queue. Warehouse 3 reaches it in 8, closer than 9 from warehouse 1. I6 stays with warehouse 2, which is at least as near. I14 stays with warehouse 1, which is nearer.","ops":[{"v":"I36","state":"area-3"},{"v":"I15","state":"current"},{"e":["I15","I6"],"state":"examined"},{"e":["I15","I14"],"state":"examined"},{"panel":"queue","list":[{"key":"I8","note":"9"},{"key":"I26","note":"10"},{"key":"I45","note":"10"}]}]},{"say":"Take I8 from the queue. Warehouse 3 reaches it in 9, closer than 20 from warehouse 1. The search goes on to I9.","ops":[{"v":"I15","state":"area-3"},{"v":"I8","state":"current"},{"e":["I8","I9"],"state":"idle"},{"e":["I8","I9"],"state":"area-3"},{"v":"I9","state":"waiting"},{"panel":"dist","set":{"I9":"13"}},{"panel":"queue","list":[{"key":"I26","note":"10"},{"key":"I45","note":"10"},{"key":"I9","note":"13"}]}]},{"say":"Take I26 from the queue. Warehouse 3 reaches it in 10, closer than 11 from warehouse 1. I25 stays with warehouse 1, which is nearer.","ops":[{"v":"I8","state":"area-3"},{"v":"I26","state":"current"},{"e":["I26","I25"],"state":"examined"},{"panel":"queue","list":[{"key":"I45","note":"10"},{"key":"I9","note":"13"}]}]},{"say":"Take I45 from the queue. Warehouse 3 reaches it in 10, closer than 21 from warehouse 1. The search goes on to I44.","ops":[{"v":"I26","state":"area-3"},{"v":"I45","state":"current"},{"e":["I45","I44"],"state":"idle"},{"e":["I45","I44"],"state":"area-3"},{"v":"I44","state":"waiting"},{"panel":"dist","set":{"I44":"13"}},{"panel":"queue","list":[{"key":"I9","note":"13"},{"key":"I44","note":"13"}]}]},{"say":"Take I9 from the queue. Warehouse 3 reaches it in 13, closer than 24 from warehouse 1. It has no neighbor left to check.","ops":[{"v":"I45","state":"area-3"},{"v":"I9","state":"current"},{"panel":"queue","list":[{"key":"I44","note":"13"}]}]},{"say":"Take I44 from the queue. Warehouse 3 reaches it in 13, closer than 24 from warehouse 1. I35 and I43 stay with warehouse 1, which is at least as near.","ops":[{"v":"I9","state":"area-3"},{"v":"I44","state":"current"},{"e":["I44","I35"],"state":"examined"},{"e":["I44","I43"],"state":"examined"},{"panel":"queue","list":[]}]},{"say":"Warehouse 3's search is done. 10 places moved to it. The farthest place from every warehouse is I28, 21 from warehouse 1, so warehouse 4 opens there next.","ops":[{"v":"I44","state":"area-3"},{"v":"I28","state":"farthest"}]},{"say":"Open warehouse 4 at I28, which was 21 from warehouse 1. A search from it goes on only while it gets closer than the drive a place already has. The search goes on to I19 and I29.","ops":[{"e":["I15","I14"],"state":"idle"},{"e":["I15","I6"],"state":"idle"},{"e":["I16","I25"],"state":"idle"},{"e":["I26","I25"],"state":"idle"},{"e":["I44","I35"],"state":"idle"},{"e":["I44","I43"],"state":"idle"},{"e":["I37","I28"],"state":"idle"},{"v":"I28","state":"center"},{"panel":"dist","set":{"I28":"0"}},{"panel":"order","list":[{"key":"I23"},{"key":"I2"},{"key":"I18"},{"key":"I28"}]},{"e":["I20","I19"],"state":"idle"},{"e":["I28","I19"],"state":"area-4"},{"v":"I19","state":"waiting"},{"panel":"dist","set":{"I19":"4"}},{"e":["I20","I29"],"state":"idle"},{"e":["I28","I29"],"state":"area-4"},{"v":"I29","state":"waiting"},{"panel":"dist","set":{"I29":"3"}},{"panel":"queue","list":[{"key":"I29","note":"3"},{"key":"I19","note":"4"}]}]},{"say":"Take I29 from the queue. Warehouse 4 reaches it in 3, closer than 10 from warehouse 2. The search goes on to I30 and I38.","ops":[{"v":"I29","state":"current"},{"e":["I29","I30"],"state":"idle"},{"e":["I29","I30"],"state":"area-4"},{"v":"I30","state":"waiting"},{"panel":"dist","set":{"I30":"5"}},{"e":["I39","I38"],"state":"idle"},{"e":["I29","I38"],"state":"area-4"},{"v":"I38","state":"waiting"},{"panel":"dist","set":{"I38":"7"}},{"panel":"queue","list":[{"key":"I19","note":"4"},{"key":"I30","note":"5"},{"key":"I38","note":"7"}]}]},{"say":"Take I19 from the queue. Warehouse 4 reaches it in 4, closer than 10 from warehouse 2. I10 and I20 stay with warehouse 2, which is at least as near.","ops":[{"v":"I29","state":"area-4"},{"v":"I19","state":"current"},{"e":["I19","I10"],"state":"examined"},{"e":["I19","I20"],"state":"examined"},{"panel":"queue","list":[{"key":"I30","note":"5"},{"key":"I38","note":"7"}]}]},{"say":"Take I30 from the queue. Warehouse 4 reaches it in 5, closer than 12 from warehouse 2. I21 and I31 stay with warehouse 1, which is at least as near.","ops":[{"v":"I19","state":"area-4"},{"v":"I30","state":"current"},{"e":["I30","I21"],"state":"examined"},{"e":["I30","I31"],"state":"examined"},{"panel":"queue","list":[{"key":"I38","note":"7"}]}]},{"say":"Take I38 from the queue. Warehouse 4 reaches it in 7, closer than 14 from warehouse 1. The search goes on to I37.","ops":[{"v":"I30","state":"area-4"},{"v":"I38","state":"current"},{"e":["I38","I37"],"state":"idle"},{"e":["I38","I37"],"state":"area-4"},{"v":"I37","state":"waiting"},{"panel":"dist","set":{"I37":"10"}},{"panel":"queue","list":[{"key":"I37","note":"10"}]}]},{"say":"Take I37 from the queue. Warehouse 4 reaches it in 10, closer than 17 from warehouse 1. It has no neighbor left to check.","ops":[{"v":"I38","state":"area-4"},{"v":"I37","state":"current"},{"panel":"queue","list":[]}]},{"say":"Warehouse 4's search is done. 5 places moved to it. 4 warehouses are open. The farthest place from every warehouse is I7, 16 from warehouse 2, so the longest drive is 16. There are 148,995 ways to choose 4 of the 45 places, too many to try. Some roads here are one way, so the factor of two isn't guaranteed.","ops":[{"v":"I37","state":"area-4"},{"v":"I7","state":"farthest"}]}],"traceNote":"","verification":"The steps come from a step-by-step copy of the algorithm. Its result is checked against gograph's on every start.","snippet":"centers, longest, err := path.KCenter(g, 4, \"I23\")\nif err != nil {\n\treturn err\n}\nfor _, v := range centers {\n\tfmt.Println(v.Label())\n}\nfmt.Println(longest)"}
