text: In the gas networks simulation and analysis, matrices turned out to be the natural way of expressing the problem. Any network can be described by set of matrices based on the network topology. Consider the gas network by the graph below. The network consists of one source node (reference node) L1, four load nodes (2, 3, 4 and 5) and seven pipes or branches. For network analysis it is necessary to select at least one reference node. Mathematically, the reference node is referred to as the independent node and all nodal and branch quantities are dependent on it. The pressure at source node is usually known, and this node is often used as the reference node. However, any node in the network may have its pressure defined and can be used as the reference node. A network may contain several sources or other pressure-defined nodes and these form a set of reference nodes for the network.<br />
  The load nodes are points in the network where load values are known. These loads may be positive, negative or zero. A negative load represents a demand for gas from the network. This may consist in supplying domestic or commercial consumers, filling gas storage holders, or even accounting for leakage in the network. A positive load represents a supply of gas to the network. This may consist in taking gas from storage, source or from another network. A zero load is placed on nodes that do not have a load but are used to represent a point of change in the network topology, such as the junction of several branches. For steady state conditions, the total load on the network is balanced by the inflow into the network at the source node.<br />
  The interconnection of a network can produce a closed path of branches, known as a loop. In figure, loop A consists of branches p12-p24-p14, loop B consists of p13-p34-p14, and loop C consists of p24-p25-p35-p34. A fourth loop may be defined as p12-p24-p34-p13, but it is redundant if loops A, B and C are also defined. Loops A, B and C are independent ones but the fourth one is not, as it can be derived from A, B and C by eliminating common branches.<br />
  To define the network topology completely it is necessary to assign a direction to each branch. Each branch direction is assigned arbitrarily and is assumed to be positive direction of flow in the branch. If the flow has the negative value, then the direction of flow is opposite to branch direction. In the similar way, direction is assigned to each loop and flow in the loop.<br />
  The solutions of problems involving gas network computation of any topology requires such a representation of the network to be found which enables the calculations to be performed in the most simple way. These requirements are met by the graph theory which permits representation of the network structure by means of the incidence properties of the network components and, in consequence, makes such a representation explicit.