home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / ai / 3261 < prev    next >
Encoding:
Text File  |  1992-08-29  |  3.2 KB  |  86 lines

  1. Newsgroups: comp.ai
  2. Path: sparky!uunet!secapl!Cookie!frank
  3. From: frank@Cookie.secapl.com (Frank Adams)
  4. Subject: Re: regions within regions
  5. Message-ID: <1992Aug28.211428.148200@Cookie.secapl.com>
  6. Date: Fri, 28 Aug 1992 21:14:28 GMT
  7. References: <3753@keele.keele.ac.uk> <SJAMESON.92Aug13083908@fergie.atl.ge.com>
  8. Organization: Security APL, Inc.
  9. Lines: 75
  10.  
  11. In article <SJAMESON.92Aug13083908@fergie.atl.ge.com> sjameson@atl.ge.com (Stephen M Jameson) writes:
  12. >In article <3753@keele.keele.ac.uk> csa09@seq1.keele.ac.uk (Paul Singleton) writes:
  13. >> I have some regions in N-space, each defined by a simple set of constraints,
  14. >> e.g.
  15. >>     0 =< X =< 5         (1)
  16. >>     0 =< Y =< 5         (2)
  17. >>     2 =< Z =< 7         (3)
  18. >>     0 =< X+Y =< 8       (4)
  19. >> 
  20. >> and I need an algorithm (for general N) to determine whether one region
  21. >> completely encloses another.
  22. >
  23. >This is based on about 5 minutes of pen-pushing, so it may need some smoothing
  24. >of the rough edges, but your algorithm will be based on the following three
  25. >facts:
  26. >
  27. >1.    Any pair of constraints on different dimensions:
  28. >
  29. >>     0 =< X =< 5        (1)
  30. >>     0 =< Y =< 5        (2)
  31. >
  32. >Implies a constraint on their sum, which is well defined because of the
  33. >limits your problem imposes on definition of the constraints.  In this case, we
  34. >have:
  35. >
  36. >    0 =< X + Y =< 10   (5)
  37. >
  38. >2.    Any two constraints:
  39. >
  40. >    a =< X =< b
  41. >    c =< X =< d
  42. >
  43. >where X is a single dimension or a sum of dimensions, can be replaced by:
  44. >
  45. >    max(a,c) =< X =< min(b,d)
  46. >
  47. >Thus while constraints (1) and (2) above imply constraint (5), combining
  48. >constraints (4) and (5) by the formula above gives constraint (4), i.e.
  49. >constraint (4) is "tighter than" or "subsumes" (5).  Thus given any set of
  50. >constraints on dimensions, you can eliminate duplicate constraints on the same
  51. >dimension or sum of dimensions.
  52. >
  53. >3.    A region A defined by a set of constraints {a_i} is completely enclosed by
  54. >another region B defined by {b_i} if and only if:
  55. >
  56. >    a.    All of the dimensions (including sums of dimensions), which are
  57. >        constrained {b_i} are also constrained by {a_i}.
  58. >
  59. >    b.    For each constraint in {b_i}, the constraint in {a_i} constraining the
  60. >        same dimension or sum of dimensions must be "tighter than" the
  61. >        constraint in {b_i}.
  62. >
  63. >Thus we have the following general algorithm:
  64. >
  65. >Given a set of dimensions {X1, X2, .. Xn}, and two sets of constraints,
  66. >{a_i} and {b_i}, where each constraint is of the form:
  67. >
  68. >    k1_i <= X_i_1 + ... + X_i_n <= k2_i             (n may be 1)
  69. >
  70. >Step 1.    For each set, using observation 1 above, generate all possible
  71. >constraints on sums of dimensions.
  72. >
  73. >Step 2.    For each set, using observation 2 above, eliminate all duplicate
  74. >constraints in each set.
  75. >
  76. >Step 3.    For each constraint in {b_i}, verify that there is a constraint in
  77. >{a_i} which constrains the same dimension or sum of dimensions and is "tighter
  78. >than" the constraint in {b_i}.  If this is the case for all constraints in
  79. >{b_i}, then the region defined by {a_i} is completely enclosed by {b_i}.
  80. >
  81. >Each step is fairly straightforward, so I won't generate pseudo-code here.
  82. >
  83. Since nobody else has done so, let me note that this is *not* a solution, or
  84. even much of a start at a solution.  This is a "linear programming" problem;
  85. accept no substitutes.
  86.