MODEL OF THE ALGORITHM FOR USER INTERACTION WITH A STRUCTURED DATA BASE FOR ADAPTIVE SORTING IN THE WEB INTERFACE
DOI:
https://doi.org/10.35546/kntu2078-4481.2025.3.2.45Keywords:
structured data, ordered matrix, web interface, adaptive sorting, Selection Sort, fuzzy matching, Levenshtein distance, database, SheetJS, REST API, JavaScript, finite automatonAbstract
Sorting tabular data in a web environment requires solutions that combine practical interactivity with mathematical rigor. This article proposes a methodology and a formalized model of a client-side interface that imports Excel/CSV files, performs data cleaning and normalization, and supports filtering and multi-criteria ordering without mandatory server logic. Two operating modes are implemented: an autonomous mode (all operations are performed in the browser with local storage) and an integration mode (optional REST export to MySQL/MongoDB/SQLite). The interface is designed for step-by-step interaction: windows for loading, data-cleaning parameter settings, criterion/priority selection, filter and partial-match settings, sorting initiation, and result viewing; separate action logging and hints for conflict conditions are provided. Technically, the solution uses HTML, CSS, JavaScript, IndexedDB/sql.js, and the XLSX library, ensuring accessibility and ease of deployment in local environments.The conceptual core is a three-component data architecture: T1 (input matrix m × n), T2 (a set of quadruples (ci, wi, di, fi) formalizing criteria and weights), and T3 (the result after filtering/projection/sorting). Each stage has clear operators:1 1 1T → f → T′ (cleaning/normalization/validation), T1′→ f2 → T2 (query construction), and T1′,T2 → f3 → T3 (instruction application). Matching of text fields supports fuzziness (in particular, the Levenshtein distance), which increases robustness to spelling variants. For multi-criteria comparison, either ( ) k k ( , k , k )kScore r = ∑w ⋅ϕ r c f or a lexicographic key is used, where ϕk is a normalized comparison function that accounts for the filter.Sorting is implemented as a modified Selection Sort with a dynamic consequential displacement constraint R = m/(i + 1), which at step i limits the intensity of permutations (≤ R) and prevents jumps in order; the instability of the base algorithm is compensated by a tie-break on the initial index. The interaction logic is formalized as a finite automaton: states correspond to windows, transitions to user events; input validation and conflict warnings are implemented, and parameter changes reactively update T3. This design ensures transparency, reproducibility, and the ability to generate control scenarios.Experimental tests on lists of parametric objects (security detectors) confirmed the correctness of transformations, stabilization of order in complex queries, convenience of step-by-step work, and moderate resource use in client-side execution. As a result, the model and software implementation combine interface interactivity with formal data rigor, provide autonomous operation with optional integration via REST API, and demonstrate practical suitability for analytics, education, and administrative scenarios in CRM/ERP contexts. The scientific novelty lies in proposing a fully client-side processing cycle (import → cleaning/normalization → filtering/projection → sorting → rendering) without a mandatory server; the three-component T1–T2–T3 scheme is formalized (T1 – input data; T2 – the “instruction” in the form of quadruples (ci, wi, di, fi); T3 – the result), which makes the tuning of criteria and weights transparent and reproducible. Compared to analogs, the developed interface stands out for its interactivity, support for text queries, and clear formalization of interaction logic, which enhances its competitiveness. Additionally, the system ensures client- side autonomy, transparent step verification, and reproducibility thanks to modeling the interface as a finite automaton and composing the operators T1 → f1 → T1′→ f2 → T2 → f3 → T3. The modified Selection Sort with the constraint R = m/(i + 1) stabilizes order under multi-criteria queries, while support for REST export and correct type conversion simplifies integration with databases (MySQL/MongoDB/SQLite) and scaling.
References
Guo M., Xing Y., Xu Y. Data Cleaning: Workflow and Strategies in Real-World Data Research. Interactive Journal of Medical Research. 2023. Vol. 12, e44310. DOI: 10.2196/44310.
Chen Z., Cafarella M. Integrating Spreadsheet Data via Accurate and Low-Effort Extraction. In: Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. 2014. P. 1126–1135. DOI: 10.1145/2623330.2623617
SheetJS. SheetJS Community Edition: Documentation (версія 0.20.3) [Електронний ресурс]. URL: https://docs.sheetjs.com/docs/ (дата звернення: 25.09.2025).
Papa Parse. Documentation (версія 5.5.3) [Електронний ресурс]. URL: https://www.papaparse.com/docs (дата звернення: 25.09.2025).
Handsontable. JavaScript Data Grid – Documentation (версія 16.0.1) [Електронний ресурс]. URL: https://handsontable.com/docs/javascript-data-grid/ (дата звернення: 25.09.2025).
Huang Y., Miao J., Weng D., Perer A., Wu Y. StructVizor: Interactive Profiling of Semi-Structured Textual Data. In: CHI ’25: Proceedings of the 2025 CHI Conference on Human Factors in Computing Systems. 2025. DOI: 10.1145/3706598.3713484.
Berger B., Waterman M. S., Yu Y. W. Levenshtein distance, sequence comparison and biological database search. IEEE Transactions on Information Theory. 2021. Vol. 67, no. 6. P. 3287–3294. DOI: 10.1109/TIT.2020.2996543
Firmansyah M., Deswana D. Application of the Levenshtein Algorithm in Web-Based Knowledge Management Systems. JUSIFO. 2024. Vol. 10, no. 2. P. 99–106. DOI: 10.19109/jusifo.v10i2.21951
Harel D. Statecharts: a visual formalism for complex systems. Science of Computer Programming. 1987. Vol. 8, no. 3. P. 231–274. DOI: 10.1016/0167-6423(87)90035-9
Pohl E., Geldermann J. PROMETHEE-Cloud: a web app to support PROMETHEE-based multi-criteria decision analysis. EURO Journal on Decision Processes. 2024. Vol. 12, 100053. DOI: 10.1016/j.ejdp.2024.100053
Razavi Hajiagha S. H., Heidary Dahooie J., Meidutė-Kavaliauskienė I., Govindan K. A new dynamic multi-attribute decision making method based on Markov chain and linear assignment. Annals of Operations Research. 2022. Vol. 315, no. 1. P. 159–191. DOI: 10.1007/s10479-022-04644-0
Hamel A. H., Kostner D. Multi-weight ranking for multi-criteria decision making. Neural Computing and Applications. 2024. DOI: 10.1007/s00521-024-10626-z
Taherdoost H., Madanchian M. Multi-Criteria Decision Making (MCDM) Methods and Concepts. Encyclopedia. 2023. Vol. 3, no. 1. P. 77–87. DOI: 10.3390/encyclopedia3010006
Su J., Zhu Q., Jiang Y., Xiao X. A Multi-Criteria Group Decision-Making Method for Risk Assessment of Live-Streaming E-Commerce Platforms. Journal of Theoretical and Applied Electronic Commerce Research. 2023. Vol. 18, no. 2. P. 1126–1141. DOI: 10.3390/jtaer18020057
Győrödi C. A., Győrödi R., Olah A., Pecherle G. MongoDB vs. Document-Based MySQL: A Comparative Study on the Top of Docker. Big Data and Cognitive Computing. 2022. Vol. 6, no. 2. P. 49. DOI: 10.3390/bdcc6020049
Alyasiri B., Sahi B., Al-Khafaji N. NoSQL: Will it be an alternative to a relational database? MySQL vs MongoDB comparison. In: Proceedings of the 2nd International Multi-Disciplinary Conference: Integrated Sciences and Technologies (IMDC-IST 2021), 7–9 September 2021, Sakarya, Turkey. EAI, 2022. DOI: 10.4108/eai.7-9-2021.2314925







