Grey Structural Modeling (GSM for short) is a new approach of system modeling method succeeding to ISM and FSM. GSM is based on the two procedures: estimating a hierarchy of the elements and estimating paths among the elements. The former is constructed from complex equations including set operation. In this paper, a significant algorithm of the GSM procedure is presented for reliable implementation. The main problem we should solve is how to group the elements into several classes and to determine their hierarchy in the computation. First of all, these procedures are shown in a pseudo language with several figures. The main idea is that two new arrays are defined to manage the elements of hierarchy, and the set operation is founded on the matrix and those arrays computation. Three examples in decision-making are shown with the developed program. The result shows that this algorithm is reliable and the developed program is useful for decision-making.