文件名称:PostofficeLocation
介绍说明--下载内容均来自于网络,请自行研究使用
算法设计。简单邮局选址问题。
--
在一个按照东西和南北方向划分成规整街区的城市里,n个居民点散乱地分布在不同的街区中。用x 坐标表示东西向,用y坐标表示南北向。各居民点的位置可以由坐标(x,y)表示。街区中任意2 点(x1,y1)和(x2,y2)之间的距离可以用数值|x1-x2|+|y1-y2|度量。
居民们希望在城市中选择建立邮局的最佳位置,使n个居民点到邮局的距离总和最小。
编程任务:
给定n 个居民点的位置,编程计算n 个居民点到邮局的距离总和的最小值。-Algorithm design. The siting of a simple post office.- In an east-west and north-south direction in accordance with the divided into regular city blocks, n distribution of settlements scattered in different neighborhoods in. With east-west coordinates x, y coordinates with north-south. The location of the settlements by the coordinates (x, y) said. Arbitrary blocks 2:00 (x1, y1) and (x2, y2) can use the distance between the values | x1-x2 |+ | Y1-y2 | metrics. Residents hope that in the cities to choose the best position to establish the post office, so that n settlements to the sum of the smallest distance from the post office. Programming tasks: n given the location of settlements, programming calculation n settlements to the post office the sum of the minimum distance.
--
在一个按照东西和南北方向划分成规整街区的城市里,n个居民点散乱地分布在不同的街区中。用x 坐标表示东西向,用y坐标表示南北向。各居民点的位置可以由坐标(x,y)表示。街区中任意2 点(x1,y1)和(x2,y2)之间的距离可以用数值|x1-x2|+|y1-y2|度量。
居民们希望在城市中选择建立邮局的最佳位置,使n个居民点到邮局的距离总和最小。
编程任务:
给定n 个居民点的位置,编程计算n 个居民点到邮局的距离总和的最小值。-Algorithm design. The siting of a simple post office.- In an east-west and north-south direction in accordance with the divided into regular city blocks, n distribution of settlements scattered in different neighborhoods in. With east-west coordinates x, y coordinates with north-south. The location of the settlements by the coordinates (x, y) said. Arbitrary blocks 2:00 (x1, y1) and (x2, y2) can use the distance between the values | x1-x2 |+ | Y1-y2 | metrics. Residents hope that in the cities to choose the best position to establish the post office, so that n settlements to the sum of the smallest distance from the post office. Programming tasks: n given the location of settlements, programming calculation n settlements to the post office the sum of the minimum distance.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
C2 -- 邮局选地址.files
C2 -- 邮局选地址.htm
[C2].PostofficeLocation.cpp
C2 -- 邮局选地址.htm
[C2].PostofficeLocation.cpp