Question: Compactness with Maple

Let M be a list of intervals of the form RealRange(Open(a[k]),Open(b[k])), k=1..nops(M).
For example,
restart; with(RandomTools):
L := [seq(RealRange(Open(Generate(float(range = 0 .. 10^4, digits = 4))),
Open(Generate(float(range = 0 .. 10^4, digits = 4)))), j = 1 .. 2*10^3)];
If the right end is less than the left end, then  BottomProp is generated, not an interval.
These elements (approximately one half) should be removed.
M := selectremove(c-> is(c = BottomProp), L)[2];

              RealRange(Open(18.94), Open(6187.))
Let a segment S:= RealRange(a,b) be given, say, S:=RealRange(1,1000). How to create a Maple procedure P(M,S), which determines whether M is a covering of S and, if so, chooses the subcovering of S, having the minimum sum of the lenghts of its intervals?

Please Wait...