{"title":"找出两个点集中最大的分离矩形","authors":"","doi":"10.1016/j.tcs.2024.114778","DOIUrl":null,"url":null,"abstract":"<div><p>Given a set <em>R</em> of <em>n</em> red points and a set <em>B</em> of <em>m</em> blue points, we study the problem of finding a rectangle that contains all the red points, the minimum number of blue points and has the maximum area. We call such a rectangle a <em>maximum-area separating rectangle</em> (MSR). We first address the planar, axis-aligned (2D) version, and present an <span><math><mi>O</mi><mo>(</mo><mi>m</mi><mi>log</mi><mo></mo><mi>m</mi><mo>+</mo><mi>n</mi><mo>)</mo></math></span> time, <span><math><mi>O</mi><mo>(</mo><mi>m</mi><mo>+</mo><mi>n</mi><mo>)</mo></math></span> space algorithm. The running time reduces to <span><math><mi>O</mi><mo>(</mo><mi>m</mi><mo>+</mo><mi>n</mi><mo>)</mo></math></span> if the points are pre-sorted by one of the coordinates. We also consider the planar arbitrary orientation version, in which the MSR is allowed to have arbitrary orientation. For this arbitrary orientation version, our algorithm takes <span><math><mi>O</mi><mo>(</mo><msup><mrow><mi>m</mi></mrow><mrow><mn>3</mn></mrow></msup><mo>+</mo><mi>n</mi><mi>log</mi><mo></mo><mi>n</mi><mo>)</mo></math></span> time and <span><math><mi>O</mi><mo>(</mo><mi>m</mi><mo>+</mo><mi>n</mi><mo>)</mo></math></span> space. Finally, we address the 3D axis-aligned version, which asks for the <em>maximum-volume separating box</em> (MSB), i.e., the maximum-volume axis-aligned box containing all the red points and the fewest blue points. For this version, we give an algorithm that runs in <span><math><mi>O</mi><mo>(</mo><msup><mrow><mi>m</mi></mrow><mrow><mn>2</mn></mrow></msup><mo>(</mo><mi>m</mi><mo>+</mo><mi>n</mi><mo>)</mo><mo>)</mo></math></span> time and <span><math><mi>O</mi><mo>(</mo><mi>m</mi><mo>+</mo><mi>n</mi><mo>)</mo></math></span> space.</p></div>","PeriodicalId":49438,"journal":{"name":"Theoretical Computer Science","volume":null,"pages":null},"PeriodicalIF":0.9000,"publicationDate":"2024-08-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Finding the largest separating rectangle among two point sets\",\"authors\":\"\",\"doi\":\"10.1016/j.tcs.2024.114778\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><p>Given a set <em>R</em> of <em>n</em> red points and a set <em>B</em> of <em>m</em> blue points, we study the problem of finding a rectangle that contains all the red points, the minimum number of blue points and has the maximum area. We call such a rectangle a <em>maximum-area separating rectangle</em> (MSR). We first address the planar, axis-aligned (2D) version, and present an <span><math><mi>O</mi><mo>(</mo><mi>m</mi><mi>log</mi><mo></mo><mi>m</mi><mo>+</mo><mi>n</mi><mo>)</mo></math></span> time, <span><math><mi>O</mi><mo>(</mo><mi>m</mi><mo>+</mo><mi>n</mi><mo>)</mo></math></span> space algorithm. The running time reduces to <span><math><mi>O</mi><mo>(</mo><mi>m</mi><mo>+</mo><mi>n</mi><mo>)</mo></math></span> if the points are pre-sorted by one of the coordinates. We also consider the planar arbitrary orientation version, in which the MSR is allowed to have arbitrary orientation. For this arbitrary orientation version, our algorithm takes <span><math><mi>O</mi><mo>(</mo><msup><mrow><mi>m</mi></mrow><mrow><mn>3</mn></mrow></msup><mo>+</mo><mi>n</mi><mi>log</mi><mo></mo><mi>n</mi><mo>)</mo></math></span> time and <span><math><mi>O</mi><mo>(</mo><mi>m</mi><mo>+</mo><mi>n</mi><mo>)</mo></math></span> space. Finally, we address the 3D axis-aligned version, which asks for the <em>maximum-volume separating box</em> (MSB), i.e., the maximum-volume axis-aligned box containing all the red points and the fewest blue points. For this version, we give an algorithm that runs in <span><math><mi>O</mi><mo>(</mo><msup><mrow><mi>m</mi></mrow><mrow><mn>2</mn></mrow></msup><mo>(</mo><mi>m</mi><mo>+</mo><mi>n</mi><mo>)</mo><mo>)</mo></math></span> time and <span><math><mi>O</mi><mo>(</mo><mi>m</mi><mo>+</mo><mi>n</mi><mo>)</mo></math></span> space.</p></div>\",\"PeriodicalId\":49438,\"journal\":{\"name\":\"Theoretical Computer Science\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":0.9000,\"publicationDate\":\"2024-08-13\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Theoretical Computer Science\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://www.sciencedirect.com/science/article/pii/S0304397524003955\",\"RegionNum\":4,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q3\",\"JCRName\":\"COMPUTER SCIENCE, THEORY & METHODS\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Theoretical Computer Science","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0304397524003955","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, THEORY & METHODS","Score":null,"Total":0}
引用次数: 0
摘要
给定由 n 个红色点组成的集合 R 和由 m 个蓝色点组成的集合 B,我们研究的问题是如何找到一个包含所有红色点、最少蓝色点且面积最大的矩形。我们称这样的矩形为最大面积分离矩形(MSR)。我们首先讨论平面、轴对齐(2D)版本,并提出一种 O(mlogm+n) 时间、O(m+n) 空间的算法。如果按其中一个坐标对点进行预排序,运行时间将缩短为 O(m+n)。我们还考虑了平面任意方向版本,即允许 MSR 具有任意方向。对于这种任意方向版本,我们的算法需要 O(m3+nlogn) 的时间和 O(m+n) 的空间。最后,我们讨论三维轴对齐版本,该版本要求得到最大体积分离盒(MSB),即包含所有红点和最少蓝点的最大体积轴对齐盒。对于这个版本,我们给出了一种运行时间为 O(m2(m+n)) 、空间为 O(m+n) 的算法。
Finding the largest separating rectangle among two point sets
Given a set R of n red points and a set B of m blue points, we study the problem of finding a rectangle that contains all the red points, the minimum number of blue points and has the maximum area. We call such a rectangle a maximum-area separating rectangle (MSR). We first address the planar, axis-aligned (2D) version, and present an time, space algorithm. The running time reduces to if the points are pre-sorted by one of the coordinates. We also consider the planar arbitrary orientation version, in which the MSR is allowed to have arbitrary orientation. For this arbitrary orientation version, our algorithm takes time and space. Finally, we address the 3D axis-aligned version, which asks for the maximum-volume separating box (MSB), i.e., the maximum-volume axis-aligned box containing all the red points and the fewest blue points. For this version, we give an algorithm that runs in time and space.
期刊介绍:
Theoretical Computer Science is mathematical and abstract in spirit, but it derives its motivation from practical and everyday computation. Its aim is to understand the nature of computation and, as a consequence of this understanding, provide more efficient methodologies. All papers introducing or studying mathematical, logic and formal concepts and methods are welcome, provided that their motivation is clearly drawn from the field of computing.