Scientific Reports (Apr 2023)

Hierarchical data structures for flowchart

  • Peng Zhang,
  • Wenzhang Dou,
  • Huaping Liu

DOI
https://doi.org/10.1038/s41598-023-31968-z
Journal volume & issue
Vol. 13, no. 1
pp. 1 – 14

Abstract

Read online

Abstract Flowcharts have broad applications in the fields of software development, engineering design, and scientific experimentation. Current flowchart data structure is mainly based on the adjacency list, cross-linked list, and adjacency matrix of the graph structure. Such design originated from the fact that any two nodes could have a connection relationship. But flowcharts have clear regularities, and their nodes have a certain inflow or outflow relationship. When graph structures such as an adjacency table or an adjacency matrix are used to store a flowchart, there is a large room for optimization in terms of traversal time and storage complexities, as well as usage convenience. In this paper we propose two hierarchical data structures for flowchart design. In the proposed structures, a flowchart is composed of levels, layers, and numbered nodes. The nodes between layers are connected according to a certain set of systematic design rules. Compared with the traditional graph data structures, the proposed schemes significantly reduce the storage space, improve the traversal efficiency, and resolve the problem of nesting between sub-charts. Experimental data based on flowchart examples used in this paper show that, compared with adjacency list, the hierarchical table data structure reduces the traversal time by 50% while their storage spaces are similar; compared with adjacency matrix, the hierarchical matrix data structure reduces the traversal time by nearly 70% and saves the storage space by about 50%. The proposed structures could have broad applications in flowchart-based software development, such as low-code engineering for smart industrial manufacturing.