# An Approach to Aid Decision-Making by Solving Complex Optimization Problems Using SQL Queries
## 5 Conclusions  
This paper presented a novel approach for solving complex optimization problem instances using an approach based on SQL queries. The solutions can support a decision-making process. The approach was evidenced in the solution of three classical optimization problems (Portfolio Selection Problem (PSP), Maximum Clique Problem (MCP), and Three-Coloring Problem (3 CG)) using only SQL queries, and the validity and performance of this approach were assessed.  
The model for solving the 3 CG problem using a SQL query was tested on a set of 48 random planar graphs. Using the query, the solution of such instances required less than 20 min per instance. Furthermore, the performance of the SQL queries was tested by comparing them against naive brute force strategies. Results on the latter showed that the naive algorithm might be the wrong choice when all the circumstances are not considered and that the use of SQL queries represents, compare to them, a simple, efficient, and easy-to-implement strategy.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Strategy** & **Time Complexity** & **Space Complexity** & **Memory for DB Tables** \\ \hline PSP SQL & \(O(n^{k})\) & \(O(n^{k})\) & \(O(n^{2})\) \\ MCP SQL & \(O(n^{k})\) & \(O(n^{k})\) & \(O(n+m)\) \\
3 CG SQL & \(O(n^{n})\) & \(O(k^{n})\) & \(O(K)\) \\ \hline \hline \end{tabular}
\end{table}
Table 5: Time and space complexity analysis.  
The versatility of the solutions based on SQL queries was studied on two cases of studies. One of them was presented to show how to use SQL queries to solve Community Network problems related to data analysis in a research community. The case study proposed a solution to the problem of self-reference groups. The other case of study demonstrated how other optimization problems can be easily adapted to exploit the use of the proposed queries.  
In general, the simplicity of the SQL language makes it easier to use than a procedural language because SQL does not require complex structures or programming skills to state the solution for an optimization problem instance. Furthermore, the use of SQL queries makes the proposed approach easy to use and understand. However, the approach has limitations related to the performance of the DBMS used to solve the queries; this can affect the size of the instances that can be solved according to some time constraints.  
For this reason, it is essential to emphasize that the proposal to use SQL queries to solve optimization problems does not pretend to compete with other strategies regarding speed. Still, it does so concerning the quality of the solutions and, above all, in the simplicity and novelty. Readers interested in knowing the best-reported algorithms to solve the MCP, PSP, and 3 CG could review the works [35; 36; 37; 38].  
A final conclusion from the research and results shown in this paper is that it is possible to solve relevant optimization problems using a high-level non-procedural language without writing a line of code, i.e., it could be easy to develop a basic DSS to help decision-makers to have solutions for complex optimization problem instances.  
Conceptualization, [PERSON]-J.; methodology, [PERSON]-J., N.R.-V. and H.A.-G.; software, N.R.-V.; validation, J.T.-J., N.R.-V., M.D.-l.-T. and H.A.-G.; formal analysis, [PERSON]-J.; investigation, [PERSON]-J.; resources, M.D.-l.-T. and H.A.[PERSON]; data curation, [PERSON]; writing--original draft preparation, [PERSON], [PERSON] and [PERSON]; writing--review and editing, [PERSON], [PERSON], [PERSON] and [PERSON]; visualization, [PERSON]; supervision, [PERSON]; project administration, [PERSON]; funding acquisition, [PERSON]. All authors have read and agreed to the published version of the manuscript. This research received no external funding. The second author acknowledges the support from CONACYT Projects No. 1340, 3058, A1-S-11012, 236154, and 280081 and to the Laboratorio Nacional de Tecnologas de la Informacion (LANTI). The authors declare no conflict of interest.