X

Help Articles are product support tips and information straight from the NV5 Geospatial Technical Support team developed to help you use our products to their fullest potential.



5679 Rate this article:
1.0

Constructing Steiner Triple Systems with IDL

This Help Article will provide code to construct Steiner Triple Systems using IDL.

Discussion
A Steiner triple system is an ordered pair (S,T), where S is a finite set of points or symbols, and T is a set of 3-element subsets of S called triples, such that each pair of distinct elements of S occurs together in exactly one triple of T. It can be shown that a Steiner triple system of order v exists if and only if v mod 6 = 1 or 3.

Here is an example of a Steiner triple system (constructed using the sts routine found on this page):

IDL> print, sts(9)
1 2 3
4 5 6
7 8 9
1 4 8
2 5 9
3 6 7
1 7 5
2 8 6
3 9 4
4 7 2
5 8 3
6 9 1

NOTE: This routine calls a routine named LATIN_SQUARE. For more information about this routine click here.

function sts, sz
case (sz mod 6) of
1:begin ; Skolem construction.
n = sz/6
chils = latin_square(2*n, idempotent = 2)
s = lindgen(3,2*n)+1
t = lonarr(3,sz*(sz-1)/6)
inf = 0

; Type 1 triples
for i = 0, n-1 do t[*,i] = s[*,i]
; Type 2 triples
count = n
for i = 0, n-1 do begin
t[0,count:count+2] = inf
t[1,count:count+2] = s[0:2,n+i]
t[2,count] = s[1,i]
t[2,count+1] = s[2,i]
t[2,count+2] = s[0,i]
count = count+3
end
; Type 3 triples
for j = 0, 2*n-1 do begin
for i = 0, j-1 do begin
t[0,count:count+2] = s[0:2,i]
t[1,count:count+2] = s[0:2,j]
t[2,count] = s[1,chils[i,j]-1]
t[2,count+1] = s[2,chils[i,j]-1]
t[2,count+2] = s[0,chils[i,j]-1]
count = count+3
endfor
endfor ; j
return, t
end

3:begin ; Bose construction.
n = sz/6
cils = latin_square(2*n+1, idempotent = 1)
s = lindgen(3,2*n+1)+1
t = lonarr(3,sz*(sz-1)/6)

; Type 1 triples
for i = 0, 2*n do t[*,i] = s[*,i]
; Type 2 triples
count = 2*n+1
for j = 0, 2*n do begin
for i = 0, j-1 do begin
t[0,count:count+2] = s[0:2,i]
t[1,count:count+2] = s[0:2,j]
t[2,count] = s[1,cils[i,j]-1]
t[2,count+1] = s[2,cils[i,j]-1]
t[2,count+2] = s[0,cils[i,j]-1]
count = count+3
endfor
endfor
return, t
end
else: begin
void = dialog_message('A Stiener Triple System of order V '+ $
'exists if and only if (V mod 6) = 1 or 3. Returning 0', /info)
return, 0
endelse
endcase
end
Please login or register to post comments.
Featured

End-of-Life Policy Enforcement for ENVI 5.3 / IDL 8.5 and Earlier Versions

5/6/2024

April 1, 2024 Dear ENVI/IDL Customer,  We are reaching out to notify you of our supported... more »

How to Upgrade licenses to ENVI 6.x / IDL 9.x

12/5/2023

What is the new Upgrade function? Starting with ENVI 6.0 and IDL 9.0, we have implemented an... more »

What to do if the 'License Administrator - License Server' for the Next-Generation License Server does not start?

6/13/2023

Background: With the release of ENVI 5.7 & IDL 8.9 and the corresponding Next-Generation licensing... more »

Next-Generation Licensing FAQ

4/28/2023

  NV5 Geospatial has adopted a new licensing technology for all future releases of our ENVI, IDL... more »

The IDL Virtual Machine

6/6/2013

What is the IDL Virtual Machine? An IDL Virtual Machine is a runtime version of IDL that can... more »