Signal Flow Graphs

An algorithm or an algebraic expression can be visually represented through a Signal Flow Graph (SFG). In this chapter, we will:

  • Illustrate what a signal flow graph looks like.
  • Define a signal flow graph and its components in detail.
  • Construct a signal flow graph for the Fibonacci series.

What does a signal flow graph look like?

Consider an algorithm that takes two variables, say aa and bb, as inputs and produces their sum, denoted by yy, as the output:

y=a+by=a+b

Here, yy is the variable representing the sum of aa and bb.

Example:

a=1,b=3y=1+3=4a=1, b=3\rightarrow y=1+3=4 \\

The operation y=a+by=a+b can be represented visually in the following way:

A simple signal flow graph

or, if the operation is not clear from the context, we can illustrate it explicitly, as in:

A signal flow graph with addition

This representation is called a Signal Flow Graph (SFG). A signal flow graph is a visual representation of an algorithm that takes various inputs (here, aa and bb) and produces corresponding outputs (here, yy). We will now examine the components of an SFG.

Components of an SFG

A signal flow graph is mainly composed of nodes and edges, where nodes represent variables and are depicted as dots, and edges are line segments connecting any two nodes. In the following SFG, there are three nodes, aa, bb, and yy. There are also two edges: one connecting node aa to node yy, and another connecting node bb to node yy.

input and output nodes in SFG

Node aa and node bb are called input nodes, and yy is called an output node.

An input node has only outgoing edges. An output node has only incoming edges. A mixed node can have both incoming and outgoing edges. We will look at examples involving mixed nodes shortly.

An edge represents a specific operation. For example, in the graph above, if the edges represent addition, then the output variable yy is given by

y=a+by=a+b

If the operation is a comparison, then yy is given by

y=max(a,b)y=max(a,b)

or

y=min(a,b),y=min(a,b),

depending on which comparison operation is used.

The arrow on an edge indicates its direction, which determines whether it is an incoming or outgoing edge with respect to a node. If no direction is specified, we assume a left-to-right direction; that is, the edge is outgoing from the node on the left and incoming to the node on the right.

An SFG describes how variables interact with one another through nodes and edges.

A mixed node is a node that has both incoming and outgoing edges, like the nodes pp and qq in the illustration below.

A mixed node or an output node always represents the result of its incoming edges, depending on the operations associated with those edges. Let us consider the following SFG:

A signal flow graph with mixed nodes

Here, if the operation associated with the edges is addition, then

p=a+bq=c+dy=p+q\begin{aligned} p&=a+b\\ q&=c+d\\ y&=p+q \end{aligned}

Node pp is the sum of the values arriving from nodes aa and bb. Node qq is the sum of the values arriving from nodes cc and dd. Finally, node yy is the sum of the values arriving from nodes pp and qq.

Weighted Edges

An edge can have a weight assigned to it. The weight is a factor that multiplies the value of a node before the operation associated with the edge is applied. Let us look at the following example to understand this.

A weighted signal flow graph

In the above graph, the weight 33 multiplies aa, and the weight 77 multiplies bb. The operation is assumed to be addition.

The addition operation then produces the output

y=3a+7b=3a+7b\begin{aligned} y&=3\cdot a+7\cdot b\\ &=3a+7b \end{aligned}

If an edge has no weight assigned to it, then the weight is assumed to be 11, meaning the node value is multiplied by a factor of 11. For example, in the SFG below with the operation defined as addition:

A simple signal flow graph

The value of yy is given by

y=1a+1b=a+b\begin{aligned} y&= 1\cdot a+1\cdot b\\ &=a+b \end{aligned}

Subtraction can be achieved by using negative weights on an edge. For example, in the SFG below:

A weighted signal flow graph

The value of yy is

y=3a+(1)b=3ab\begin{aligned} y&=3\cdot a + (-1)\cdot b\\ &=3a-b \end{aligned}

Signal flow graphs can be used to represent and interpret a wide variety of algorithms and problems. Let us look at one example next.

The Fibonacci series as an SFG

Consider the famous Fibonacci series:

0,1,1,2,3,5,8,130,1,1,2,3,5,8,13\cdots

Each element in the series is the sum of the previous two elements, with the first and second elements being 00 and 11 respectively.

The Fibonacci sequence can be represented as an SFG in which the edges perform the addition operation. Let us build the Fibonacci SFG for elements up to 1313. Let

a=0,b=1a=0, \quad b=1\\

These two variables, aa and bb, are the input nodes of our SFG. The next element,

c=a+b=0+1=1,c=a+b=0+1=1,

can be represented as:

First numbers of Fibonacci in signal flow graph

For the next element,

d=b+c=1+1=2,d=b+c=1+1=2,

we add two edges and a node dd to obtain:

The Fibonacci sequence as a signal flow graph

Similarly, node e=c+d=1+2=3e=c+d=1+2=3 is represented as:

sfg10.png

We continue constructing the SFG until we reach the output node

h=f+g=5+8=13h=f+g=5+8=13

The Fibonacci sequence as a signal flow graph

The above SFG can be extended further to reach any nthn^{th} Fibonacci element. Therefore, the algorithm for calculating the nthn^{th} Fibonacci element can also be represented as a Signal Flow Graph, where we take the first two elements as input nodes and the nthn^{th} element appears as the output node. Other nodes are mixed.

For readers already familiar with the Fibonacci SFG, the graph can, for simplicity, be represented without directions, as follows:

The Fibonacci sequence as a signal flow graph without using arrows

In general, when we know the context of the algorithm that the SFG is representing, it is common to illustrate the edges without using arrows.

In the next chapter, we will see how to use Signal Flow Graphs to write an algorithm to perform the NTT.

This article is part of a series on the Number Theoretic Transform in our ZK Book

Ready to Get Started?Join Thousands of Users Today

Start your free trial now and experience the difference. No credit card required.

© 2026 Better-Start. All rights reserved.