7
Systems of Linear Equations and their Graphical Solution Proceedings of the World Congress on Engineering and Computer Science 2014 Vol I WCECS 2014, 22-24 October, 2014, San Francisco, USA ISBN: 978-988-19252-0-6 ISSN: 2078-0958 (Print); ISSN: 2078-0966 (Online) WCECS 2014

Systems of Linear Equations and their Graphical … of Linear Equations and their Graphical Solution Proceedings of the World Congress on Engineering and Computer Science 2014 Vol

  • Upload
    lynga

  • View
    224

  • Download
    9

Embed Size (px)

Citation preview

Page 1: Systems of Linear Equations and their Graphical … of Linear Equations and their Graphical Solution Proceedings of the World Congress on Engineering and Computer Science 2014 Vol

Systems of Linear Equations and their Graphical Solution

Proceedings of the World Congress on Engineering and Computer Science 2014 Vol I WCECS 2014, 22-24 October, 2014, San Francisco, USA

ISBN: 978-988-19252-0-6 ISSN: 2078-0958 (Print); ISSN: 2078-0966 (Online)

WCECS 2014

Page 2: Systems of Linear Equations and their Graphical … of Linear Equations and their Graphical Solution Proceedings of the World Congress on Engineering and Computer Science 2014 Vol

The possible values for s lie in the interval [0,1].As the ratio between the number of zeroed elementsand the number of elements if it were full grows, thesparsity degree will grow. On the other hand, s = 0represents a fully connected system (i.e. every nodeis connected to every other node). Between these twoextremes (i.e. 0 < s < 1), A is neither full nordecoupled and its corresponding graph will not befully connected (i.e. not all the nodes are connectedamong them). It turns out that many physical systemssolved using linear systems are very sparse i.e s→ 1.In particular, in electrical power systems, the matri-ces which represent transmission networks are verysparse. This is the main reason why sparsity tech-niques have been improved by research whose goalis to solve efficiently the actual state of the powersystem; such as the best elimination ordering [5],[8]. Sparsity techniques have been around since atleast 1970 using a technique known as bifactorization[9]. The main principles used in bifactorization arestrongly directed toward exploiting the underlyingmatrix graph.

Therefore in order to approach the solution usingits graph representation, first an appropriate modelhas to be derived. This model has to be able torepresent the complete SLE elements (i.e. A, x, andb). The model proposed in this document is based ona per equation basis. This representation is given infigure 1.

a ix..+ ija jx +.. bi=+..+

xi

aii

ibaji

aij

ii

Fig. 1. Conversion from a linear system ofequations to its graph model

In this model an equation is represented by twocomponents: a node and a set of links. The nodeis a well defined component which consists of twosubcomponents: a circle consisting of two half partsand an arc. The upper part of the circle representsthe variable related to this equation which has tobe solved by the system (i.e. xi) and the lower partrepresents the coefficient related to this variable in

equation i (i.e. aii). The arc represents the i − thcomponent in b (i.e. bi). The second part depends onthe SLE topology and is represented by links whichconnect the nodes. These links will be denoted as(i, j) where i and j represent the row and the columnnumber respectively. There can be zero or more linkswhich connect the node with some other nodes inthe graph. Each link has an associated value for thecoefficient located in the row i column j (i.e. aij).Perhaps it is a little absurd to consider the case wherethere are no external links. However, as will be shownlater, this is the basic configuration which will alwaysbe pursued in order to solve the SLE.

In order to illustrate these concepts let us instan-tiate equation 1 to equation 3

0.5 −1 −1 0−1 2 −1 0−1 −1 1 −10 0 −2 4

x1x2x3x4

=

00−50

(3)

Applying the model defined in figure 1 to eachequation, the graph shown in figure 2 is obtained.

x =?1 x =?2

−1

3

x =?4

4

−1 −2

x =?

−1 −1

0

0.5

02

1

−5

0

Fig. 2. Graph corresponding to the systemdefined by equation 3

Unidirectional links (→ and ←) have to be usedas in general aij 6= aji, as shown by links (3, 4)and (4, 3), representing elements a34 and a43. Ifaij = aji then these elements are represented witha bidirectional link (↔) as shown by the link (1, 3),representing elements a1,3 and a3,1. This graph repre-sents an asymmetric SLE (ASLE). An ASLE is a SLEwhere there exists at least one pair of links (i, j), (j, i)where i 6= j, such that aij 6= aji holds.

Proceedings of the World Congress on Engineering and Computer Science 2014 Vol I WCECS 2014, 22-24 October, 2014, San Francisco, USA

ISBN: 978-988-19252-0-6 ISSN: 2078-0958 (Print); ISSN: 2078-0966 (Online)

WCECS 2014

Page 3: Systems of Linear Equations and their Graphical … of Linear Equations and their Graphical Solution Proceedings of the World Congress on Engineering and Computer Science 2014 Vol

In this document the main aim is to express New-ton’s method to solve non-linear optimisation prob-lems using a graph approach. The kind of matricesinvolved in such problems are symmetric, thereforethe main focus will be on this subset of SLE.

III. Symmetric Systems of Linear Equationsand Its Graphical Representation.

Symmetric systems of linear equations (SSLE) areSLEs where aij = aji holds for all i, j. These arevery well behaved matrices with some special proper-ties; such as real eigenvalues, orthogonal eigenvalues;as analysed in [7]. This document will not deal withthe analysis of the properties these systems hold. Themain interest here is how to represent such systemsusing graphs and how to exploit them in order tosolve the SLE. SSLEs are very common in physicalsystems, in particular, a great range of problemsin electrical power systems can be addressed withSSLEs. To represent SSLEs into its graphical form,the graph representation proposed in figure 1 ismodified as shown in figure 3.

a ix..+ ija jx +.. bi=+..+

aijxi

aii

ibii

Fig. 3. Conversion from a symmetric linearsystem of equations to its graph model

The only modification in this variant is with regardto the unidirectional links. The graphs representingSSLEs must contain only bidirectional links. Thelink representation has been modified and the arrowsare no longer used as they do not give any extrainformation. In order to illustrate these concepts letus instantiate equation 1 with equation 4 which isbasically equation 3 where the element a43 has beenset to −1 in order to be equal with element a34.

0.5 −1 −1 0−1 2 −1 0−1 −1 1 −10 0 −1 4

x1x2x3x4

=

00−50

(4)

Applying the model defined in figure 3, yields thegraph shown in figure 4

2

−1

3

x =?4

x =?1 x =?

−5

04

−1

x =?

−1 −1

0

0.5

02

1

Fig. 4. Graph corresponding to the systemdefined by equaion 4

SSLEs can be described as perfect SLEs; they arewell behaved and their properties have been knownfor a long time. However, there exists a subset ofSSLE which besides all those properties possessed bythem, have another property. They can be representedwith a graph known as a tree and as a consequenceall the well known algorithms regarding trees can beapplied to them. For reasons which will be explainedin the following chapters these will be the SLEsthis document will be dealing with. Therefore, theattention will be focused on this kind of systems.

IV. Tree Structured Symmetric Systems ofLinear Equations and Its Graphical Repre-sentation.

Tree structured symmetrical systems of linearequations (TSSSLE) are SSLE where the graph rep-resenting the SSLE is a tree. Based on this structure,efficient algorithms can be derived in order to solvethis kind of systems. These algorithms emerge natu-rally, just by exploiting the properties of trees. Thiskind of graphs have been applied to solve electricaldistribution networks whose main characteristic is itsradial shape (i.e. no loops exists in the network).Therefore a tree structure can be derived for the SLErepresenting these systems. Algorithms to solve dif-ferent problems with different degree of complexityhave been proposed for distribution networks based

Proceedings of the World Congress on Engineering and Computer Science 2014 Vol I WCECS 2014, 22-24 October, 2014, San Francisco, USA

ISBN: 978-988-19252-0-6 ISSN: 2078-0958 (Print); ISSN: 2078-0966 (Online)

WCECS 2014

Page 4: Systems of Linear Equations and their Graphical … of Linear Equations and their Graphical Solution Proceedings of the World Congress on Engineering and Computer Science 2014 Vol

on this structure in [4], [3], [2], [6]. A deeper analysisof this kind of systems will be done in anothercontribution.

A tree-shaped graph has to be free of loops.This work does not deal with how to identify andremove loops from graphs. Therefore, graph 4 willbe converted into a graph representing a TSSLEby removing the link (1, 2). This implies removingelements a12 and a21 from matrix A. Let us instan-tiate equation 1 with equation 5 which is basicallyequation 4 where elements a12 and a21 have been setto 0

0.5 0 −1 00 2 −1 0−1 −1 1 −10 0 −1 4

x1x2x3x4

=

00−50

(5)

Applying the model defined in figure 3, leads tothe graph shown in figure 5 which is graph 4 wherelink (1, 2) has been removed.

x =?1 x =?2

−1

3

x =?4

1

−5

04

x =?

−1 −1

0

0.5

02

Fig. 5. Graph corresponding to the systemdefined by equation 5

This example will be used throughout this chapter.The system will be solved using different strategieswhich have to lead to the same solution. To this endGaussian elimination will be used as the main tool tosolve the system.

V. Gaussian Elimination and Its graphicalInterpretation

Gaussian elimination is a general method to solvea SLE. It consists of the iterative application ofelementary row operations which lead the system

to an echelon form. This is achieved by modifyingeach of the elements which do not belong to thecolumn and row to the equation under reduction.These elements are modified using expression 6.

a′

ij = aij −aikakjakk

(6)

Gaussian elimination can be regarded as a matrixtransformation from Rn×n → Rn−1×n−1. The result-ing system has all the information needed to solve thesubsystem resulting from the transformation. Whendealing with sparse systems several observations haveto be done. Figure 6(a) represents an sparse matrixand figure 6(b) shows the transformation it undertakeswhen Gaussian elimination is applied to x1. Darkgray entries represent elements which di not change.Elements in light gray represent those whose valuechanges and the entries in red denote elements whosevalues were zero before the transformation, i.e. theywere created.

(a) Before the elimination (b) After the elimination

Fig. 6. Gaussian elimination and its matrixinterpretation for a sparse matrix

Now, let us analyse the transformation in its graph-ical representation. To this end, let us define Γk asthe set of nodes connected to node k. In this caselet us instantiate k = 1 as the node to be eliminated;consequently, Γ1 = {2, 3, 4}. A graph interpretationfor this transformation is shown in figure 7. Herefigure 7(a) represents the state of the graph before thetransformation is applied and figure 7(b) representsthe state of the graph after the transformation hasbeen applied.

This shows that when node k is eliminated thenthe nodes which are connected to it, Γk, will forma complete graph among them as a result of thistransformation. This is reflected by equation 7

Proceedings of the World Congress on Engineering and Computer Science 2014 Vol I WCECS 2014, 22-24 October, 2014, San Francisco, USA

ISBN: 978-988-19252-0-6 ISSN: 2078-0958 (Print); ISSN: 2078-0966 (Online)

WCECS 2014

Page 5: Systems of Linear Equations and their Graphical … of Linear Equations and their Graphical Solution Proceedings of the World Congress on Engineering and Computer Science 2014 Vol

x

x

x

x

x

5

1

2

3

4

(a) Before the elimination

x

x

5

2

3

4

1x

x

x

(b) After the elimination

Fig. 7. Gaussian elimination and its graphinterpretation for a sparse matrix

Γ′j ← (Γj ∪ Γk) \ {j, k} ∀j ∈ Γk (7)

Where Γj and Γ′j denote the neighbour nodesof node j before and after the transformation, re-spectively. If nodes i and j were connected beforethe transformation then the value for the link (i, j)which was connecting them (shown in dark gray)will be updated by equation 6. On the other hand,if they were not connected (i.e. aij = 0) then theseinterconnections would have to be created (shown inred). If no pair of nodes i, j, where i, j ∈ Γk, wereconnected before the transformation then a completesubgraph would be created among them. The numberof links needed to build this subgraph, Nk, is givenby equation 8.

Nk =|Γk| (|Γk| − 1)

2(8)

Therefore, Gaussian elimination has two costs: onewhich has to be applied every time is updating, andthe second one is the creation of new links, known inthe literature as fill-ins. Furthermore, from figure 7(b)link (3, 5) and node 5 were not used at all in thetransformation. Here is where the power of sparsemethods appears in systems whose components arelossely coupled as they do not deal with elements notinvolved in the transformation. Obviously, the burdenset by sparse methods have to be avoided if the sys-tems under study are known to be very full matriceswhich derive almost complete graphs tranformations.[1] gives a deeper description about the modificationsof the graph as the reduction process is applied.

VI. Graph-based Solution for Symmetric Sys-tems of Linear Equations

Solving a SLE, when translated to its graph coun-terpart, means to assign some value to the questionmarks shown in figure 5 such that they fulfills allthe equations. It is desirable to end up with the samevalues as the initial configuration but as it will beseen this is not possible as the successive applicationof the Gaussian elimination will modify these values.Furthermore, the final configuration will depend onthe order in which the Gaussian elimination wasapplied. How were these values obtained? There areseveral methods to solve SLE which are based onGaussian Elimination. Here the graph is reduced byapplying Gaussian elimination, one node at a timeiteratively, until the graph is reduced to just one node.This method is known as forward elimination. At thispoint the system can be solved as its configuration is

a′iixi = b′i

from this xi is solved with a value of

xi =b′ia′ii

Then a process called backward substitution can beapplied by solving the previous node and so on. It isimportant to keep the tree structure in the eliminationprocess as it will perform the fastest and cheapestsolution for the SLE. Let us apply the Gaussianelimination to the example graph given in figure 5.The first question is which node has to be appliedthe elimination on? A more advanced question iswhich elimination order has to be applied?. This isan open question and has been addressed in differentscenarios. There are several elimination orders whichwill take us to the solution of the system. In fact, thetotal number of elimination orders, Ne, for a systemwith n variables and n equations is nn. However,some of them can not be applied as they would lead toan inconsistent system. An inconsistent configurationappears when the node where Gaussian elimination isto be applied is zero. This would lead equation 6 to anundefined value and would stop the reduction process.If we derive a configuration where all the nodes arezero then the system is said to be singular. Therefore,in its matrix version, this situation is avoided by

Proceedings of the World Congress on Engineering and Computer Science 2014 Vol I WCECS 2014, 22-24 October, 2014, San Francisco, USA

ISBN: 978-988-19252-0-6 ISSN: 2078-0958 (Print); ISSN: 2078-0966 (Online)

WCECS 2014

Page 6: Systems of Linear Equations and their Graphical … of Linear Equations and their Graphical Solution Proceedings of the World Congress on Engineering and Computer Science 2014 Vol

interchanging (or renumbering) rows and columns,provided the system is not singular. In the graphrepresentation just an inspection have to be done atthe actual node where the Gaussian elimination is tobe applied. If its value is zero then its reduction isdelayed to a later moment.

In this section, two different elimination orderswill be applied to the graph system shown in figure 5in order to obtain some insight about the Gaussianelimination process (applying all the possible ordersimplies 4! = 24 elimination orders). The first elimi-nation order shown in 8 is 1 → 2 → 4 → 3. First,node one, using the reduction shown in figure 5, isreduced into node 3 as shown in figure 8(a). In thesame way, node 2 is reduced into node 3 as shownin figure 8(b). Finally, as for the reduction process,node 4 is reduced into node 3 as shown in the upperpart of figure 8(c). Now x3 can be solved, as shownin bottom part of figure 8(c). Once x3 is solved, thesubstitution process can be applied as node 1, 2, and4 were connected to node 3 only. This process leadsto the configuration shown in figure 8(d). As it can beappreciated, no new links are created. Furthermore,node 3 is the only node whose initial configurationis modified.

The second elimination order, shown in figure 9,is 3 → 4 → 2 → 1. Here, three new links arecreated when node 3 is eliminated as |Γ3| = 3. Theinitial configuration for all nodes has been modified.Furthermore, in order to solve x3 the rest of thevariables have to be solved. To solve x4, first x1 andx2 have to be solved. Finally, to solve x2, first x1must be solved.

A. About the Importance of the Initial Configura-tion

In the previous examples, the modification to theinitial configuration was mentioned. This is importantto preserve or at least try to preserve it as muchas possible as there are iterative algorithms whichwill be using this configuration in order to reachthe solution. If the algorithm which solves the graphmodifies this configuration at every iteration, then thiswill have to be reinstantiated in each of them.

02

x =?4

−1

2

−1

−1

−5

x =?

04

x =?3

(a)

04

x =?3

−1.5

4

−5

−1

x =?

(b)

−5

−1.75

x =?3

207

−5

−1.75

3x = __

(c)

x =3

x =4

101 x =2

7

740

7x =−1 −1

0

0.5

02

−5

04

__

−1

__

__20

__

1.75

7

5

(d)

Fig. 8. The graph solution with eliminationorder 1→ 2→ 4→ 3

VII. Concluding Remarks

In this work the graph representations for SLEs,SSLE and TSSSLE have been presented. Here wehave learnt the differences among them and the factthat TSSSLE ⊂ SSLE ⊂ SLE. Then Gaussianelimination and its graphical interpretation has beenpresented. Even that different elimination orders havethe same solution when Gaussian elimination is ap-plied, some will require less operations to reach thesolution. Also depending on this elimination ordera variable number of new links will be created ornot. Furthermore, some elimination orderings are notallowed as they will derive graphs whose pivot wheregaussian elimination is to be applied is zero.

When solving a SLE, the objective is to find thevalues for variables represented by vector x. Thebasic tool to find those values will be based onthe Gaussian elimination. The processing task forthis graph will address the previous features so nolinks are created at all. A TSSSLE is a SLE whichcan be represented with a tree. Finally,the solutionto TSSSLE does not require the creation of links,

Proceedings of the World Congress on Engineering and Computer Science 2014 Vol I WCECS 2014, 22-24 October, 2014, San Francisco, USA

ISBN: 978-988-19252-0-6 ISSN: 2078-0958 (Print); ISSN: 2078-0966 (Online)

WCECS 2014

Page 7: Systems of Linear Equations and their Graphical … of Linear Equations and their Graphical Solution Proceedings of the World Congress on Engineering and Computer Science 2014 Vol

1 x =?2

3

4

x =?−1

1−0.5

x =?

−5 −5

−5

−1−1

(a)

6

__−43

3−5 2__

1x =?

2x =?

__3

__

__

3−20−20

(b)

1x =?

__6

__6

−120

−21

__6

−217__40

1x =

__6

−120

(c)

6

__−43

__3

−20

7−5

10

__1

x =2

x =

__

__

3−20

23

__40__7

(d)

3−20

__6

−21

10

4

__

__

__7

x =

−5

−1−1

3

2x=

__23

1x =

__6

−120

__407 −1

57

(e)

x =3

x =4

__740

1

1 x =2

__−120 −203

x =−1 −1

−5

03

__

−1

__20

__

7

57

710

__6

__−21 32

__6

(f)

Fig. 9. The graph solution with elimination order 3→ 4→ 2→ 1

therefore is a very efficient structure which everysolution algorithm must try to derive.

References

[1] Anne Berry and Pinar Heggernes. The minimum degreeheuristic and the minimal triangulation process. In Proceed-ings of WG 2003, pages 58–70. Springer Verlag, 2003.

[2] G.J. Chen, K.K. Li, T.S. Chung, and G.Q. Tang. Anefficient two-stage load flow method for meshed distributionnetworks. In Proceedings of the 5th Conference on Advancesin Power System, Control, Operation and Management, AP-SCOM 2000, pages 537–542, October 2000.

[3] D. Das, H. S. Nagi, and D. P. Kothari. Novel method forsolving radial distribution networks. IEE Proceedings onGeneration, Transmission and Distribution, 141(4):291–298,July 1994.

[4] S. K. Goswami and S.K. Basu. Direct solution of distributionsystems. IEE Proceedings on Generation, Transmission andDistribution, 138:78–85, 1991.

[5] Harry M. Markowitz. The elimination form of the inverse andits application to linear programming. Management Science,3(3):255–269, April 1957.

[6] S.F. Mekhamer, S.A. Soliman, M.A. Moustafa, and M.E. El-Hawary. Load flow solution of radial distribution feeders:A new contribution. Electrical power and Energy Systems,24:70–707, 2002.

[7] Gilbert Strang. Linear Algebra and Its Applications. BrooksCole, 4 edition, July 2005.

[8] W. F. Tinney and J. W. Walker. Direct solutions of sparsenetwork equations by optimally ordered triangular factoriza-tion. Proceedings of the IEEE, 55(11):1801–1809, 1967.

[9] K. Zollenkopf. Bifactorization: Basic computational al-gorithm and programming techniques. In Oxford, editor,Conference on Large Sets of Sparse Linear Equations, pages76–96, 1970.

Proceedings of the World Congress on Engineering and Computer Science 2014 Vol I WCECS 2014, 22-24 October, 2014, San Francisco, USA

ISBN: 978-988-19252-0-6 ISSN: 2078-0958 (Print); ISSN: 2078-0966 (Online)

WCECS 2014