<<

The Pennsylvania State University The Graduate School Capital College

SpaceView: A visualization tool for of rank at most 3

A Master’s Paper in Computer Science by Padma Gunturi

°c 2002 Padma Gunturi

Submitted in Partial Fulfillment of the Requirements for the Degree of

Master of Science

April 2002 Abstract

This paper presents some algorithms and a program called SpaceView for visualizing and manipulating matroids with rank at most 3. Simple matroids with rank at most 3 are also known as combinatorial geometries or linear spaces. The points and lines diagram for such a is called its geometric representation. SpaceView takes as input a matroid of rank at most 3 and outputs its geometric representation. The user can move the points and lines, thereby animating the entire configuration. The user can perform matroid operations such as deletion, contraction and relaxation and can also obtain the corresponding to the inclusion relation between the points and lines.

i Table of Contents

Abstract i

Acknowledgement iii

List of Figures iv

1 Introduction 1

2 SpaceView 8

3 Design and Algorithms 13

4 Conclusion 19

References 20

ii Acknowledgement

I would like to take this opportunity to express my deepest gratitude to my project advisor, Dr. S. R. Kingan. Her guidance and inspiration have been of tremendous help to me during the course of this project. Her patience and experience have helped me go through some of the most difficult times in the project. I would like to extend my hearty thanks to Dr. T. N. Bui, not only for serving on my advisory committee, but also for introducing me to Matroid Theory. His suggestions and comments during the several meetings were extremely helpful. I also would like to thank my academic advisor, Dr. L. Null and Prof. H. Royer for their immense guidance and support during my stay at Penn State, Harrisburg. I wish to thank Dr. R. J. Kingan for helping us build this visualization tool and continually giving us a helpful hand whenever we needed it. I would like to thank him also for sharing some of his experiences with us during this project. Thanks to Dr. Haidong Wu for recommending the book The Theory of Finite Linear Spaces. The book introduced me to the embeddability of linear spaces in projective planes and this knowledge has greatly helped us in developing SpaceView. Thanks to Karishma, Kate and Zhaoxia for making my stay at PSH both enjoyable and memorable. My special thanks to K. Richwine for all the help and encouragement during my master’s program. Finally, I would like to thank my husband for his loving affection and constant encouragement during my study.

iii List of Figures

1 Representation of K4 ...... 3 2 Well-known linear spaces ...... 5 3 Projective planes of order 3 and 5 ...... 7 4 Some other interesting linear spaces ...... 9 5 Fano representations after performing the matroid operations . 11

iv 1 INTRODUCTION 1

1 Introduction

Computer science professor Andrew J. Hanson describes the importance of visualization in mathematics and physics as follows [8]:

“Visualization in general embodies a transformation between a body of knowledge and a picture, or perhaps an interactive animation, capable of representing features of the data to the viewer. In general, the hope is that the displayed features will stimulate associations in the mind of the user that will lead to further insights, suggest new hypotheses to test, and thus advance the progress of science more rapidly than without this methodology.

Mathematics and mathematical physics (like most other visualization domains, in fact) have potentially direct relations between the con- cepts in question and the choice of representation: it seems obvious to try to represent a geometric object by a faithful picture of the ge- ometry. Several situations typically arise when we ask whether such a picture can assist mathematical research. There is nothing con- ceptually new about the picture, but it was di–cult or impossible to construct without either computer assistance, or a clever technique for producing an easy computer representation of the geometry, or both. A new way of transforming the data to an image exposes aspects of the object not evident from the geometry alone. The ability to inter- actively alter, deform, optimize, re-parameterize, or manipulate the object permits us to examine limits and features that were unavail- able without a computer graphics representation and manipulation system. In general, the idea of simply seeing global, holistic features of an object that has never been depicted before can potentially sug- gest associations that algebraic analysis alone might miss.”

We designed and implemented a Java program called SpaceView for vi- sualizing and manipulating matroids with rank at most 3. We begin by reviewing background material on matroids with rank at most 3. In Chapter 2, we describe how SpaceView can be used as a research and pedagogical 1 INTRODUCTION 2 tool. In Chapter 3, we give the design and algorithm details. We conclude in Chapter 4 with suggestions for future work in this area. Matroids are a generalization of a number of combinatorial objects. Among them are graphs, matrices, linear spaces, affine spaces and projective spaces. The matroid terminology used here follows Oxley [13]. Portions of this in- troduction are taken from [5]. A matroid M is defined as an ordered pair (E, I) consisting of a finite set E and a collection I of subsets of E called independent sets such that:

I1 ∅ ∈ I

I2 If I1 ∈ I and I2 ⊆ I1, then I2 ∈ I

I3 If I1, I2 ∈ I and |I1| < |I2| then there exists an element

e ∈ I2 − I1 such that, I1 ∪ e ∈ I.

A dependent set is a subset of E not in I. A circuit is a minimal dependent set. A matroid is called simple if it has no 1- or 2-point circuits. A basis is a maximal independent set. The rank of M is the size of a basis set. For a subset X of E, the rank of X is the size of a maximal independent subset in X. The closure of X is the union of X and all points e not in X, such that r(X ∪ e) = r(X). We say X is closed if r(X ∪ e) = r(X) + 1 for all points e not in X. A flat is a closed set. A hyperplane is a flat of rank r(M) − 1. Matroids of rank at most 3 can be represented as a geometry in which the points, lines, and planes correspond to the rank-1, rank-2, and rank-3 flats, respectively. To simplify the diagram, lines with fewer than three points on them are not shown in the representation. Figure 1 and Figure 2 give representations of some popular matroids. A geometric representation for a matroid of rank at most 3 is a diagram of points and lines governed by the following rules:

(1) All loops are marked in a single inset. (2) Parallel points (2-point circuits) are represented by touching points. 1 INTRODUCTION 3

1

4 2 5 5 6

1 3 ¡ ¢¡¢ 2 4 3 6 graphic geometric

Figure 1: Representation of K4

(3) Any two distinct points belong to exactly one line and any line contains at least 2 distinct points.

It follows from rule (3) that any two distinct lines meet in at most one point. For a graph G, let E be the set of edges and C be the set of cycles of G. Then (E, C) is a matroid called the cycle matroid of G. A matroid is called graphic if it can be represented as the cycle matroid of a graph. For a matrix A over a field F , let E be the set of columns and I be the set of independent sets of columns. Then (E, I) is a matroid called the vector matroid of A over the field F . A matroid is called representable if it can be represented as a matrix over a field. Since we are focusing only on rank 3 matroids, the only simple graphic matroids are subgraphs of the complete graph on four vertices, K4. A graphic and a geometric representation for K4 are shown in Figure 1. It should be noted that this paper is not really about graphs and the reader is encouraged not to think of these diagrams in terms of vertices and edges but rather as a geometry consisting of points and lines where the lines can be curved. We will now view rank 3 matroids from the perspective of linear spaces. Simple rank 3 matroids are also called linear spaces. There is much literature on linear spaces and an entire book called The Theory of Finite Linear Spaces which makes no mention of the word matroid. In fact, many matroid theorists prefer to call simple matroids combinatorial geometries. The 1 INTRODUCTION 4 terminology used here will follow Batten and Beutelspacher [4]. This portion is taken from a survey on linear spaces by S. R. Kingan [11]. A linear space is a pair S = (P, L) consisting of a set P of points called points and a set L of distinguished subsets of points called lines satisfying the following:

(S1) Any two distinct points of S belong to exactly one line of S; and (S2) Any line of S has at least two distinct points of S.

A linear space is called non-trivial if there are three points not on a com- mon line. The number of points and lines are denoted by v and b, respectively. Points will be denoted by lower case letters and lines by upper-case letters.

For a point p, rp denotes the number of lines on p. For a line L, kL denotes the number of points on L. Figure 2 gives three examples of well-known lin- ear spaces: a near-pencil on 6 points, the of order 2 (Fano plane), and the affine plane of order 3. A near-pencil on v ≥ 3 points is the linear space having one line with (v − 1) points and v − 1 lines with two points each. The affine and projective planes form two important classes of linear spaces and we discuss them in detail. An affine plane is a linear space which satisfies the additional axiom:

(A) if a point p is not on the line L, then there is a unique line on p missing L.

This axiom is equivalent to Euclid’s famous fifth postulate, also known as the parallel postulate. It states that through a given point p not on a line L, there is one and only one line in the plane of p and L which does not meet L [2]. The real Euclidean plane is an example of an infinite affine space. So is the plane with integer points. In fact, affine planes are an abstraction of the real plane. There are points and lines and the parallel postulate holds but, there are no concepts for distance and angles. The following theorem describes the structure of affine planes and suggests a construction for them. 1 INTRODUCTION 5

1

3 8 9

¡ ©¡©

¡ ¡

¡ ©¡©

¡ ¡

¡ ¢

¨

£¡£ ¡ §¡§¨ ¡

2 6 ¤¡¤

£¡£ ¡ §¡§ ¡ 7 ¤¡¤ 4

5 7

¡ ¡ 

3 5 ¥¡¥ ¡ 4 ¦¡¦ 1 6 2 projective plane of order 2 (Fano plane) affine plane of order 3

5

4

3

2 6

1 near-pencil on 6 points.

Figure 2: Well-known linear spaces

Theorem 1.1. Let F be a skew field and denote by V a 2-dimensional vec- tor space over F . Define the structure A = A(V ) as follows. The points of A are the elements of V . The lines of A are the (right) cosets of 1-dimensional subspaces of V , that is, the sets U + v where U is a 1-dimensional subspace. Then A is an affine plane. ¥

A projective plane is a linear space that satisfies the additional axioms:

(P1) any two distinct lines have a point in common; and (P2) there are four points, no three of which are on a common line.

The analog of Theorem 1.1 for projective planes is as follows:

Theorem 1.2. Let F be a skew field and denote by V a 3-dimensional over F . Define the structure P = P (V ) as follows. The points of P are 1 INTRODUCTION 6 the 1-dimensional subspaces of V . The lines of P are the 2-dimensional sub- spaces of V . The point p ‘is in’ the line L if the corresponding 1-dimensional subspace lies in the corresponding 2-dimensional subspace. Then P is a pro- jective plane. ¥

If a linear space is an affine plane, then there exists an integer n ≥ 2 such 2 2 that v = n , b = n + n, rp = n + 1 and kL = n for all points p and lines L. If a linear space is a projective plane, then there exists an integer n ≥ 2 such 2 2 that v = n + n + 1, b = n + n + 1, rp = kL = n + 1 for all points p and lines L. This integer n is called the order of the affine or projective plane. When the field F under consideration is a finite field (denoted by GF (q) for some prime power q) the affine and projective planes are denoted as AG(2, q) and P G(2, q), respectively. In this case, n = q and we get a nice layout for the points in the form of a q by q grid. Figure 3 gives the geo- metric representations of P G(2, 3) and P G(2, 5). There is a close connection between affine and projective planes. Removing a line and all of its points from a projective plane results in an affine plane. Similarly, an affine plane can be extended to a projective plane by adding a line with (n + 1) points. This line is called the “line at infinity” and the points are called the “points at infinity”. In general, suppose P and L are disjoint sets of points and lines, re- spectively, and i is the relation such that it satisfies the following axioms:

(i) Any two distinct points, a and b, are on exactly one line ab. (ii) Every line contains at least three points. (iii) If a, b, c, and d are four distinct points, no three of which are collinear, and if the line ab intersects the line cd, then the line ac intersects the line bd.

Then the triple (P, L, i) is called a . A projective space of dimension 2 is called a projective plane. Two projective spaces (P, L, i) and (P 0 , L0 , i0 ) are isomorphic if there is a ζ : P → P 0 such that a 1 INTRODUCTION 7

13 11 8

¡ ©¡©

¡

¡

¢¡¢

£¡£¤ ¡ §¡§  ¡

12 10 ¨¡¨ 5 2

¡  ¥¡¥ ¡ ¡ 9 ¦¡¦ 1

6

¡

¡ ¡

7 4

¡ ¡ 3 P G(2, 3)

26

"" $$

31 

XX 

YY  !! ## %% "" $$

 21 11 XX

 16

YY  !! ## %%

20 15

VV &&  44 <<

WW '' 55 == 30  25 10

19 9

TT (( .. 66 >> LLM

UU // 77 ?? 29 )) 2 24 14

18

RR 00 88 @@

23** 13 8

SS 11 99 AA 28 ++

22

PP ,, 22 :: BB

QQ 33 ;; CC 27 -- 1

17 12

DDE

HH II

7 4

JJ

KK

FF

GG NN OO 5 6 3

P G(2, 5)

Figure 3: Projective planes of order 3 and 5 2 SPACEVIEW 8 subset X of P is in L if and only if ζ(X) is in L0 . There are finite projective planes that are not isomorphic to any P G(2, q). The next result by Vanstone and de Whitte [4] establishes the condition under which a linear space can be embedded in a projective plane.

Proposition 1.3. Suppose that S is a linear space with v ≥ n2 and rp ≤ n + 1, then S can be embedded in a projective plane of order n ≥ 2. ¥

We use Theorem 1.1, Theorem 1.2, and Proposition 1.3 in our algorithms to draw the geometric representation of matroids. Figure 4 gives some other interesting linear spaces.

2 SpaceView

SpaceView is the first piece of geometric software that focuses solely on geometric representations of matroids with rank at most 3 and on matroid operations. It can draw any rank 3 matroid entered either as a matrix or as points and lines. It handles loops and parallel elements, supports ani- mation, and allows the user to perform the matroid operations of deletion, contraction, relaxation etc. SpaceView draws “nice” colorful geometric representations, very similar to the way mathematicians have always drawn them. These geometric con- structions would be difficult to draw using standard computer-aided drawing methods. Hence interactive techniques are provided to allow manipulations, thus making the representations look nicer. SpaceView uses cubic curves to allow the user to manipulate the points and lines in the representation. It should be noted that, all the point-line incidences in the geometric picture are maintained during these manipulations thus preserving the correctness of the picture. These interactive techniques have also proven to be helpful for the user to draw “nice” pictures of matroids that have complicated geometric layouts. SpaceView not only displays an interactive picture of the geometric rep- 2 SPACEVIEW 9

1 1

2 4 6 2 4 6

3 5 3 7 5

1 1

2 5 2 8 5

3 6 3 6 8

4 7 4 9 7

§¡§¨ ¡ ¢ ¡    



¡ ¥¡¥¦ ¡  $$%

!! ""#

©¡© £¡£¤ ¡    

Figure 4: Some other interesting linear spaces 2 SPACEVIEW 10 resentation but also allows the user to delete points and lines, contract points, relax circuit-hyperplanes, and obtain the corresponding bipartite graph. Moreover, in the case of representable matroids, the user can also obtain the matroid P G(2, q) \ M. The only existing software package related to SpaceView is Groups and Graphs, a broad purpose package that handles graphs, digraphs, geometric configurations, combinatorial designs and their groups. Like SpaceView, Groups and Graphs also has animation, which is clearly an im- portant feature in a geometric software. Groups and Graphs is a nice piece of software, however, it has different goals. For geometric configurations, Groups and Graphs serves only as a tool that allows the user to draw points and lines on the screen. SpaceView contains an Input applet and an Output applet that displays the geometric representation. To run this applet the user needs a Java- enabled web browser. If the browser doesn’t have the necessary Java features, the user will be prompted to download the appropriate Java plug-in from Sun Microsystems. The user can enter the matroid as a matrix over a prime field (if it is representable) or in general as a set of points and lines. In the first case, the user must select the “Enter as a Matrix” checkbox and then must enter the modulus, number of elements, rank, and matrix in the corresponding textboxes. In the second case, the user must select the “Enter as Points and Lines” checkbox and then must enter the number of points and the set of lines. Finally, the user must press OK to view the geometric representation in the Output applet along with the list of flats. Initially, the control points of the cubic curves are not shown in the representation. These points can be made visible by pressing the ‘control points’ button in the Output applet. Additionally, flats can be highlighted, which is a useful feature for matroids with many elements. We now explain each of these operations in detail. We denote the set of independent sets, circuits, bases and flats of a matroid M as I(M), C(M), B(M), and F(M). Figure 5 shows geometric representations of the Fano 2 SPACEVIEW 11

1 7

1

2 6

3 4 5 3 5

F7 \ 7 (Deletion of a point) F7 \ {2, 4, 6} (Deletion of a line)

1

2 6 2,3 4,7 5,6 7

F7/1 (Contraction) 3 4 5

F7 after relaxing {2,4,6}

{1,2,4} {1,3,6} {2,3,5} {3,4,7} {1,5,7} {4,5,6} {2,6,7}

¡ ¢ £¡£¤ ¡ ¡ ¥¡¥¦ §¡§¨ ©¡©

¡ ¡  ¡ ¡ ¡ ¡ ¡

{1} {2} {3} {4} {5} {6} {7}

bipartite graph of F7

Figure 5: Fano representations after performing the matroid operations 2 SPACEVIEW 12 matroid, after performing each of the following matroid operations. Let M be a matroid wih ground set E. Deletion of a subset T of E, denoted as M \ T is defined as the matroid with I(M \ T ) = {I ⊆ E − T : I ∈ I(M)}. In terms of flats, M \T is defined as the matroid with set of flats F(M \T ) = {F − T : F ∈ F(M)}. Contraction of a subset T of E, denoted as M/T is defined as the matroid with I(M/T ) = {I ⊆ E −T : I ∪BT ∈ I(M)}, where

BT ∈ B(M \ (E − T )). In terms of flats M/T is defined as the matroid with the set of flats F(M/T ) = {X ⊆ E − T : X ∪ T ∈ F(M)}. A matroid obtained from M by a sequence of deletions and/or contractions is called a minor of M. The ‘delete’ button in SpaceView allows the user to delete either a single point or a line from the representation. The point or line to be deleted is selected from the list of flats in the Output applet. The ‘contract’ button in SpaceView allows the user to contract a single point from the representation. The point to be contracted is selected from the list of flats in the Output applet. If M has a subset X that is both a circuit and a hyperplane, then removing X from M results in a matroid M 0 with B(M) ∪ {X} as its set of bases and C(M 0 ) = (C(M)−{X})∪{X ∪e : e ∈ E(M)−X}. The matroid M 0 is called the relaxation of M. The ‘relax’ button in SpaceView allows the user to relax a circuit-hyperplane in the matroid. The line to be relaxed is selected from the list of flats in the Output applet. Note that since we are dealing with rank 3 matroids, the circuit hyperplanes are precisely the 3 point lines (without parallel elements) in matroids without loops. For a matroid representable over GF (q) and entered as a matrix we define the P G(2, q) \ M as the matroid obtained from P G(2, q) by deleting the columns corresponding to the columns in M (up to equivalence classes, for example, (1, 0, 2)T is the same as (2, 0, 1)T in GF (3)). The ‘P G(2, q) \ M’ button in SpaceView gives a drawing of this matroid. This is similar to the definition of complement but we avoid issues of unique representability by defining P G(2, q) \ M in this manner. Note that this operation is available only for representable matroids and in particular only for matroids entered 3 DESIGN AND ALGORITHMS 13 as a matrix. The points and lines under the inclusion relation can be represented as a bipartite graph. Let G = X ∪ Y where X is the set of points and Y is the set of lines. Draw an edge between a point and a line if the point is contained in the line. The ‘bipartite graph’ button displays the corresponding bipartite graph.

3 Design and Algorithms

In this chapter we will describe the algorithms used in SpaceView. We follow a set of different techniques to place the points, which collectively give a “nice” representation. For example, we handle matroids entered as matrices and those entered as points and lines differently. We also handle rank 1, 2, and 3 matroids separately. The basic technique for placing the points follows from Theorem 1.1 and Proposition 1.3 in Chapter 1. Given a linear space, if v ≥ n2, where v is the number of points and n is the modulus, and if each point is incident on at most n + 1 lines, then this linear space can be embedded in a projective plane of order n ≥ 2. Hence we check this condition first and if this condition is met we use an n by n grid layout, as in P G(2, 3), shown in Figure 3. If this condition is not met, then we use a layout as in the Fano plane shown in Figure 2. We attempt to give a “nice” picture automatically by including some elementary optimization techniques. For example, we connect the points with lines (curves) starting from the point in the infinity line of the projective plane and then look for the closest next point in the line. If such a line does not contain an infinity point we join the curve with the least x co-ordinate value and proceed in the ascending direction of the x value. This approach was found to work well for most representations. Finally, we also give the user a choice of obtaining a better picture by allowing the points and lines to move. We take advantage of Java 2D’s new features and use cubic curves which is available as the part of the Shape and 3 DESIGN AND ALGORITHMS 14

Graphics2D package. A cubic curve is described by a third-order equation. These curves are specified by four points: two endpoints and two control points (indicated by a small rectangle). Each control point determines the tangent of the curve for one of the endpoints. Suppose the endpoints are p1 and p2, and the control points are c1 and c2. The tangent of the curve at p1 is determined by the line between p1 and c1. Likewise, the tangent at p2 is determined by a line from p2 to c2. These curves are also called B´ezier curves. As c1 moves farther from p1, the curve is pulled more towards c1.

Likewise, the curve is pulled more towards c2 as it moves farther from p2. As explained in Chapter 1, the geometric representation of a rank-3 ma- troid is a diagram of points and lines. If a matroid is entered as a set of points and lines, the representation algorithm can proceed to draw the geometric representation. However, if the matroid is entered as a matrix, the represen- tation algorithm requires the corresponding rank-2 flats or lines to continue. We use the flats algorithm developed by R. J. Kingan as part of the Oid framework, to find the flats for the corresponding matroid and then proceed to draw the geometric layout. We refer the reader to [5] for an explanation and implementation of the flats algorithm. SpaceView can be integrated into Oid, a system that has an extensible library of combinatorial object classes and algorithms. Oid is designed to allow developers to add new combinatorial algorithms to the system without changing the existing code. The appropriate algorithm to be used by the system is evaluated at runtime by a simple intelligent system, thus making this integration possible. We now state the algorithm used for drawing geometric representation for representable matroids entered as a matrix. Loops are placed in an inset. Parallel points are drawn as a single point labelled by all these points sepa- rated by a comma. If the rank of the matroid is 1 then one point is drawn, along with loops and parallel points, if they exist. If the rank is 2 then there is just one line that contains all the points. SpaceView draws this line. 3 DESIGN AND ALGORITHMS 15

Representation algorithm for drawing GF (q) - representable rank 3 matroids with v < q2 or q = 2

INPUT Matroid in the form of a r by v matrix, where r = 3 and v ≥ 3. OUTPUT Geometric representation of the matroid with points laid out on a triangle. STEP 1 Obtain the set of flats. STEP 2 If there are rank 0 flats (loops) then add the loops to a vector data structure L and determine the position on screen. STEP 3 If there are rank 1 flats (parallel elements in parallel classes) then add them to a vector data structure P. STEP 4 For all the rank 2 flats (lines), check the condition that “Any two distinct lines (flats) meet in at most one point”. If this condition is not satisfied display a warning. If this condition is satisfied then position the basis points on the triangle. Determine the lines joining these basis points and place the new points that are incident on these lines and draw the lines. Determine the lines (that haven’t been found in previous steps) containing newly placed points and the basis points. Place these points and draw the lines. Place each new point with some combination of already placed points, if possible, and draw the lines. Place any free elements off to the side. Draw cubic curves connecting remaining points based on the lines. Finally, place the parallel points by looking into the vector P for their positions.

Representation algorithm for drawing GF (q) - representable rank 3 matroids with v ≥ q2

INPUT Matroid in the form of a r by v matrix where r = 3 and v ≥ 3. OUTPUT Geometric representation of the matroid with points laid on a q by q grid. STEP 1 Obtain the set of flats. STEP 2 If there are rank 0 flats (loops) then add the loops to a vector data 3 DESIGN AND ALGORITHMS 16 structure L and determine the position on screen. STEP 3 If there are rank 1 flats (parallel elements in parallel classes) then add them to a vector data structure P. STEP 4 For all rank 2 flats (lines), check the condition that “Any two distinct lines (flats) meet in at most one point”. If this condition is not satisfied display a warning. If this condition is satisfied then build a vector V of all possible points (upto equivalence classes) in the projective plane of order q along with their positions. Call these points P G(2, q) points. Determine which of these points should be on the grid and the points that should lie on the infinity line. Now, match the column vectors of the given matroid to the P G(2, q) points, thus, determining the position of the points in the matroid. Place these points. Draw cubic curves connecting the points based on the lines. Finally, place the parallel points by looking into the vector P for their positions. We now state the algorithm used for drawing geometric representations for matroids entered as a set of points and lines. The input is v, the number of points and the set of lines separated by a comma (the points within the lines are separated by a space). When laying out the points on a grid, the order q is assumed to be one less than the largest line size entered. If the rank of the matroid is 1 then draw a point. If the rank is 2 then there is just one line that contains all the points. Draw the line.

Representation algorithm for rank 3 simple matroids entered as a set of points and lines with v < q2 or q ≤ 2

INPUT Matroid in the form of a set of points and lines. OUTPUT Geometric representation of the matroid with points laid out on a triangle. STEP 1 For all lines check the condition that “Any two distinct lines (flats) meet in at most one point”. If this condition is not satisfied display a warning. STEP 2 If this condition is satisfied then position the basis points (the algorithm assumes the basis points to be 1, 2, 3) on the triangle. Determine 3 DESIGN AND ALGORITHMS 17 the lines joining these basis points and place the new points that are incident on these lines and draw the lines. Determine the lines (that haven’t been done in previous steps) containing newly placed points and the basis points. Place these points and draw the lines. Place each new point with some combination of already placed points, if possible and draw the lines. Place any free elements off to the side. Draw cubic curves connecting remaining points based on the lines.

Representation algorithm for rank 3 simple matroids entered as a set of points and lines with v ≥ q2 or q > 2

INPUT Matroid in the form of a set of points and lines. OUTPUT Geometric representation of the matroid with points laid out on a q by q grid. STEP 1 For all the given lines check the condition that “Any two distinct lines (flats) meet in at most one point”. If this condition is not satisfied display a warning. STEP 2 If the condition is satisfied then determine which of these points should be on the grid and the points that should lie on the infinity line. This step gives a nice representation, and follows from Proposition 1.3. Place any free elements off to the side. Draw cubic curves connecting the points based on the lines.

Deletion Algorithm (delete a point or line)

MOUSE ACTION Select the point or line from the list of flats. Press the Delete button. OUTPUT Geometric representation of the matroid after delete operation is performed. STEP 1 If an element is selected, then delete it from the ground set and from all the lines containing it. Step 2 If a line is selected, then delete all the points in the line from the ground set and delete the line itself from the set of flats. STEP 3 Redraw the geometric representation with the new set of points and lines. 3 DESIGN AND ALGORITHMS 18

Contraction Algorithm (contract a point)

MOUSE ACTION Select a point (say e) from the list of flats. Press the Contract button. OUTPUT Geometric representation of the matroid after contract operation is performed. STEP 1 If e is a loop then M/e = M \ e. STEP 2 If e is in a parallel class P , then every other point in P becomes a loop of M/e. STEP 3 If e is not a loop or in a parallel class then all loops of M remain loops of M/e. Pick a hyperplane H not containing e. For all f in E(M) − (H ∪ e), find the line L containing {e, f}. If (L ∩ H) = {g}, for some point g, then drop all the points of L − e onto g. If (L ∩ H) = ∅, then add a new point on H. This new point represents not only f but all points in L − e. STEP 4 Redraw the geometric representation with the new set of points and lines.

Relaxation Algorithm (relax circuit-hyperplane)

MOUSE ACTION Select circuit-hyperplane (3-point lines with no parallel points) from the list of flats. Press the Relax button. OUTPUT Geometric representation of the matroid after relaxation is per- formed. STEP 1 Display warning, if user selects a hyperplane that is not a circuit or tries this operation for matroids with loops. STEP 2 Remove the circuit-hyperplane from the list of flats. STEP 3 Delete the line (only) from the geometric representation. The points are retained. STEP 4 Redraw the geometric representation with the new set of lines. 4 CONCLUSION 19

P G(2, q) \ M matroid Algorithm

MOUSE ACTION Press the P G(2, q) \ M button. OUTPUT Geometric representation of P G(2, q) \ M. STEP 1 Delete all the points of matroid M from P G(k − 1, q). Let this new matroid be called M 0 . STEP 2 Obtain the lines of M 0 using the flats algorithm. STEP 3 Redraw the geometric representation with the new set of points and lines.

Bipartite Algorithm

MOUSE ACTION Press the bipartite graph button. OUTPUT A bipartite graph. STEP 1 Check condition to make sure that the rank of the matroid is 3. If this condition is not satisfied display a warning. STEP 2 If this condition is satisfied then obtain the set of rank-1 flats (points) and rank-2 flats (lines). Join the points and lines based on the inclusion relation. STEP 3 Display the bipartite graph.

4 Conclusion

In this paper, we presented SpaceView, a tool for visualizing and manip- ulating matroids of rank at most 3. The matroid can be entered either as a matrix over GF (q) or as a set of points and lines. SpaceView is the first tool developed for visualizing matroids. We hope this capability of visual- izing and manipulating matroids will lead to new research results and help in explaining the topic to beginning students. SpaceView also allows the user to draw nice geometric pictures and to perform the following matroid operations. REFERENCES 20

1. Delete a point or line. 2. Contract a point. 3. Relax a circuit-hyperplane. 4. Obtain the matroid P G(2, q) \ M. 5. Obtain the bipartite graph.

The next step is to build a tool for visualization of rank 4 matroids. A geometric representation of a rank 4 matroid is a 3-dimensional picture. Hence, a visualization tool for such matroids would require the use of Java 3D features.

References

[1] I. Anderson, I. Honkala, “A Short Course in Combinatorial Designs”, http://www.utu.fi/ honkala/cover.html, 41 pp., 1997.

[2] M.K. Bennet, “Affine and ”, A Wiley-Interscience Publication, New York, 1995.

[3] J.E. Bonin, “A brief introduction to matroid theory”, Department of Mathematics, The George Washington University, Washington, DC, 2001.

[4] L.M. Batten, A. Beutelspacher, “The Theory of Finite Linear Spaces”, Cambridge University Press, Cambridge, New York, Melbourne, 1993.

[5] T.N. Bui, R.J. Kingan, S.R. Kingan, “An Application Framework for Combinatorial Objects and their algorithms” (submitted for publica- tion).

[6] J.E. Bonin, J.G. Oxley, B. Servatius, Editors, “Contemporary Mathe- matics”, Matroid Theory, AMS-IMS-SIAM Joint summer research con- ference on Matroid Theory, University of Washington, Seattle, July 2-6, 1995. REFERENCES 21

[7] C. Colbourn and P. Oorschot, “Applications of Combinatorial Designs in Computer Science”, ACM Computing Surveys, Vol. 21, June 1989, pp. 223-250.

[8] A.J. Hanson, “Mathematical Visualization: Standing at the Cross- roads”, IEEE Visualization 1996, San Francisco, California, http://www.cecm.sfu.ca/projects/PhilVisMath/vis96panel.html.

[9] D.R. Hughes, F.C. Piper, “Projective planes”, Springer-Verlag, New York, Heidelberg, Berlin, 1973.

[10] B. Kolman, “Introductory with applications”, Collier Macmillan Publishers, London, 1988.

[11] S.R. Kingan, “A survey and catalog of linear spaces viewed as matroids” (in preparation).

[12] W. Kocay, D. Tiessen, “Some algorithms for the computer display of geometric constructions in the real projective plane”, J. of Comb. Maths. and Comb. Computing, 19(1995), pp 171-191. 49.

[13] J.G. Oxley, “Matroid Theory”, Oxford University Press, Oxford, 1992

[14] P. Orlik, H. Terao, “Arrangement of Hyperplanes”, Springer-Verlag, New York, 1991.

[15] N. White, “Theory of Matroids”, Cambridge University Press, Cam- bridge, 1986.

[16] R.J. Wilson, “An introduction to Matroid Theory”, American Mathe- matical Monthly, Volume 80, Issue 5 (May 1973), 500-525.