English 中文(简体)
计算最小的轮式代码的功能,所有轮式代码都在X英里以内
原标题:Function to calculate smallest set of zip codes in which all zip codes are within x miles

我需要一种功能(用任何语言,最好用文字),能够使用一系列带有纬度/长度坐标的物体(例如单体代码),并返回最小的子体,即原阵列的所有成分在X(即20天)英里之内,至少是次点的1个成员。

问题回答

这里是使你开始的贪.算法。

  1. Start with an empty result set R and let S be the set of all zipcodes.
  2. For each zipcode Zn in S, calculate the set Vn of zipcodes which are within 20 miles of Zn.
  3. Find the set Vmax with the most elements - Add the corresponding zipcode Zmax into the result set R, and remove all the elements of Vmax from S.
  4. With the remaining elements in S, repeat from step 2 until S is empty. Then the final set is R.




相关问题
How to decide the current point reach on google map?

How to decide the current point reach on google map? I have a list of points (pickup points) of a route that I want to show in my google map with polyline. Now i have to get the current location of ...

Topographical or relief data in Map APIs

I was wondering if anyone knew of any map APIs that offer topographical or relief data? I ve had a quick look at Google and Bing APIs, but could find nothing there. Google allow you to view a map as ...

Using maps on Windows Mobile

I m experimenting with maps on different mobile platforms. Getting Google Maps to work on Android was easy, following this tutorial. Getting the same to work on Windows Mobile is a different matter. ...

Adding a custom icon to a google map

I need a hand adding a custom icon to some Google Maps javascript. Code below for your reference: function populateMap() { var map = new GMap2(document.getElementById("map")); map.setCenter(new ...

RSS to KML Overlay

I m want to display my blog as a Google Map overlay (each post contains geotags). How can I dynamically create a KML overlay from an RSS? Or better, how can I create a loop (PHP) that would display ...

开放街道地图管理员

我需要开放Street的标记管理员。 地图,如山角地图。

热门标签