Intelligent Procurement Scheduling System for Items Involving Public Procurement

: The procurement of goods is considered a critical part in supply chain management, and it often has several unprecedented barriers leading to failure of the project. Uncertainties in availability, cost and demand-supply matching combined with stringent government norms andprocurement policies of various organizations need a thorough study in the present-day environment to develop sustainable and lean supplychain management. In this paper, use of a fuzzy logic system to estimate the tender finalization period of engineering items that involve public procurement is discussed. The tender finalization period is normally based on key parameters, such as criticality of the requirement of an item for the project, the number of variants available in a supply, competition amongst bidders, frequency of buying the item and the tender value. The methodology to arrive at the membership functions of the key parameters and the logic used to arrive at the tender finalization period estimation are well discussed in this paper. The proposed fuzzy logic approach was applied to an industrial case and the results show good agreement between expert opinion and the fuzzy logic system output. This paper will definitely help procurement managers in any organization to plan their activities in an effective manner


Introduction
Artificial Intelligence can play a significant role in optimizing and enhancing various aspects of public procurement policy.The use of artificial intelligence can automate routine and repetitive tasks, such as document verification, data entry and basic contract analysis [1].This leads to faster processing times and reduces the risk of errors.Artificial intelligence software can assist vendors and procurement officers in navigating the procurement process, answering common queries and providing guidance on documentation requirements.Artificial intelligence algorithms can analyze historical procurement data to predict future trends, demand patterns and potential risks.This assists in making informed decisions regarding procurement strategies and supplier selection [2].In a similar manner, artificial intelligence algorithms can assess and identify potential risks associated with suppliers, contracts and market conditions, helping procurement officers to mitigate risks effectively.
The use of artificial intelligence in public procurement can help to evaluate and score suppliers based on various factors, including performance history, financial stability and compliance.This ensures that procurement decisions are based on objective and datadriven assessments.These techniques can continuously monitor and analyze the market to identify new and innovative suppliers, promoting competition and diversity in the supplier pool.Yet another advantage of using artificial intelligence algorithms in public procurement is that it can analyze market trends and historical data to predict future price fluctuations, helping organizations make cost-effective procurement decisions [3].Also, artificial intelligence techniques can monitor expenses in real-time, ensuring compliance with budget constraints and identifying potential cost-saving opportunities.By integrating artificial intelligence with block-chain, public organizations can enhance transparency in the procurement process by providing an immutable and transparent record of transactions.This helps in reducing fraud and ensuring compliance with regulations.Artificial intelligence techniques can automatically check procurement documents for compliance with legal and regulatory requirements [4], reducing the risk of errors and ensuring adherence to policies, and it can enhance cybersecurity measures by identifying and preventing potential cyber threats, ensuring the security of sensitive procurement data.
Implementing artificial intelligence in public procurement policies requires careful consideration of ethical, legal and privacy implications.Additionally, providing adequate training to procurement professionals and stakeholders is essential for the successful integration and utilization of artificial intelligence algorithm technologies [5].The main theme of this paper is about the implementation of artificial intelligence in public procurement and providing deep insight to public procurement officers to design such systems for sustainable development.This paper centers on the procurement process of supply chain management undertaken by a reputed steam generator manufacturing company through a public tendering system.The public tendering process serves as a cornerstone of transparency, fairness and accountability in public procurement across the globe.It represents a systematic and regulated approach that public entities, such as government agencies and public organizations, use to procure goods, services or construction projects from external suppliers.This process ensures that taxpayers' funds are allocated efficiently and responsibly, upholding the principles of competition, integrity and value for money.The significance of the public tendering process lies not only in its fiscal responsibility but also in its role in promoting economic development, fostering innovation and providing equal opportunities to a wide range of businesses, from small enterprises to large corporations.Whether it is a major infrastructure project, the acquisition of essential services or the purchase of everyday items, the public tendering process is a structured method for soliciting, evaluating and awarding contracts to qualified suppliers.
The public procurement process encompasses various stages, including the release of internal orders, technical specification, approval procedures, supplier selection through competitive bidding, offer evaluation, contract establishment and item supply.Despite the presence of control and monitoring systems, enterprise resource planning software [6,7], e-tendering and online reverse auctions, these processes often remain time-consuming.Projects may face delays or financial repercussions due to the criticality of certain items.While companies implement internal audits, policies and departmental procedures to manage internal issues, external challenges and unforeseen factors continue to hinder the development of procurement norms for these items.Enhancing this aspect can propel companies toward total quality management (TQM), lean principles, six sigma, and cost of quality (COQ), fostering long-term success and customer satisfaction.For public procurement, barriers exist within organizations, such as resource and capacity constraints etc., and externally in interactions with supply chain stakeholders [8,9].Existing supply chain management literature discusses the minimization of procurement costs using optimization techniques [5] and employs analytic hierarchy processes and data envelopment analysis as decision-making tools for public procurement tenders [10].Decision support systems like the Finnish resource projection model MELA have been employed for land use policy impact assessments [11].Numerous articles delve into areas like public procurement tendering, competitive bidding, decision-making models for supply chain management, purchasing models and schedule prioritization techniques using heuristic methods [12][13][14][15][16][17][18].Nevertheless, a comprehensive review of the literature highlights the underexplored realm of establishing procurement norms based on empirical data.
In this increasingly complex and data-driven world, decision-making processes have become more intricate than ever before.Traditional decision-making methods, often reliant on rigid binary logic, can struggle to capture the subtleties and uncertainties inherent in many real-world scenarios.This is where machine learning [19][20][21][22] and fuzzy logic systems [23] emerge as a powerful tool, offering a flexible and intuitive approach to decision-making that mimics human cognitive processes.Considering the potential for improvement, especially in the context of public procurement, this paper endeavors to employ artificial intelligence techniques, such as machine learning and fuzzy logic systems, to derive optimal procurement norms.Public entities and companies that are bound by various regulatory guidelines, procedures and policies in compliance with state and federal bodies stand to benefit from this proposed approach.
Fuzzy logic systems have gained prominence in control and decision-making processes for multi-criteria problems in supplychain management [24,25].Fuzzy logic, enables us to handle vagueness and ambiguity effectively based on imprecise and uncertain information, as it is based on the concept of "degrees of truth", allowing for a more nuanced evaluation of input variables and the generation of more refined, context-aware decisions, which will be more useful in the present area of study.This paper will uncover how these systems harness the power of linguistic variables, membership functions and fuzzy rules to navigate complex decision spaces, offering solutions for industrial automation and beyond.Fuzzy logic systems generate outputs based on the degrees of truth associated with their inputs, accommodating vague and imprecise information.Fuzzy logic employs linguistic variables like "low", "medium", "high", "fast", "slow", "hot", "warm", "normal" and "cold" to represent input data.The system comprises three core components: (i) a fuzzifier controller that converts crisp values into linguistic variables, (ii) a knowledgebased system [26][27][28], and (iii) a defuzzifier controller that transforms fuzzy values into crisp physical signals for controlling system operations.Fuzzy logic systems offer flexibility, allowing for rule modifications and the acceptance of imprecise, distorted or erroneous input information [29].They find applications in various domains, including electrically driven wheeled mobile robots [30], load forecasting [31], control of domestic appliances, HVAC systems and supply chains [32].
This literature review reveals that while AI and fuzzy logic systems have been extensively studied and applied in various aspects of supply chain management and public procurement, specific application of these technologies to establish procurement norms based on empirical data remains underexplored.Existing studies focus on optimization techniques, decision support systems and cost minimization but seldom provide comprehensive methods for determining procurement norms that can adapt to the dynamic nature of public procurement.The primary research gap identified is the lack of a systematic approach to establish procurement norms using machine learning and fuzzy logic systems.This gap highlights the need for integrating empirical data with advanced AI techniques to create adaptable and efficient procurement policies.
This paper proposes a novel approach that integrates machine learning and fuzzy logic systems to establish optimal procurement norms.By identifying and focusing on the most critical input variables, this study aims to provide a data-driven decision-making framework that can adapt to the complexities and uncertainties inherent in public procurement processes.The proposed system not only addresses the existing research gap but also offers practical solutions that can enhance transparency, efficiency and cost-effectiveness in public procurement.
This work addresses a significant gap in the existing literature by providing a comprehensive framework for establishing procurement norms using AI techniques.The proposed approach has the potential to revolutionize public procurement processes, making them more efficient, transparent and responsive to changing market conditions.By offering practical insights and a robust methodology, this paper can serve as a valuable resource for researchers and practitioners in the field of supply chain management and public procurement.This paper proposes a machine learning and fuzzy-based decision-making system to provide optimal solutions for establishing procurement norms, ultimately optimizing resource utilization.The subsequent section elaborates on the procurement process, defines objectives and identifies problems.Section 3 details the development of the fuzzy-based system, while the results and discussion are presented in Section 4.

Materials and Methods
Publicly traded companies, adhering to government regulations and policies, typically establish dedicated procurement departments.In this study, we focus on the procurement of essential bought out items (BOI) necessary for steam generator systems in a reputable public corporation.The role of the BOI procurement department is pivotal within the realm of supply chain management as it necessitates seamless coordination with various project units, such as design, finance, commercial, project management and project monitoring.This coordination is vital for executing procurement processes through supplier contracts [17,33,34].It is worth noting that any enhancement or deficiency in the procurement process may only become evident at the conclusion of lengthy contracts, which often span months or even years, making immediate system changes unfeasible.
Within this study, we specifically consider items like thermal insulation and control components of steam generation systems.The major focus of this paper is on a critical milestone in the procurement process: the journey from purchase request initiation to contract finalization.The purchase request entails technical specifications, required quantities and other pertinent details for soliciting supplier proposals.Upon receiving a purchase request, purchase executives process it, transforming it into an actionable contract with legal validity and subsequently issue it to the supplier.Table 1 classifies these items and provides their average durations from purchase request initiation to contract finalization.The dataset used in this study was sourced from the procurement department of a steam generator manufacturer in India, specifically from tender processes conducted between 2019 and 2021.The datacomprises detailed records of procurement activities, including item requisitions, vendor submissions, evaluation criteria, tender outcomes and timelines for each procurement stage.The application of fuzzy logic for evaluation entails a three-step procedure.Initially, crisp inputs must undergo fuzzification.Subsequently, an inference mechanism applies fuzzy rules for evaluation and, finally, the results are defuzzified to yield crisp output values.To determine the optimal procurement norm for the purchase request to contract finalization milestone, the machine learning technique recursive feature elimination (RFE) was used to identify key inputs, as it provides a clear ranking of features based on their importance, making it straightforward to identify the most significant variables.RFE helps improve model performance by eliminating redundant and irrelevant features, leading to better generalization of unseen data as well [35][36][37].While numerous factors play a role, such as skillset, efficient coordination, item criticality, number of item variants, procurement frequency, associated risks, supplier identification, competition among suppliers, estimated procurement value, approval processes, customer endorsement, quality assessments, commercial agreements, tender durations and more, the machine learning algorithm ranked the top five most influential variables that impact procurement duration.These key input variables are (1) the criticality of the item's requirement for the project.Criticality is identified as an event that has occurred and is impacting the project.Critical issues require immediate attention and real-time action and may be the result of risks identified at the start of the project or may come from an invisible area not initially considered.The organization has attached a criticality factor on a scale of 1 to 30, where "30" indicates the item is most critical for the project.(2) The number of variants available within a supply.For example, procurement of castables will normally be required in two variants: one is grade-A and the other is grade-C (3) Competition, as indicated by the number of suppliers submitting offers for a particular tender.(4) The frequency of item procurement within a fiscal year.(5) The tender estimate value in terms of 0.1 million rupees.
The flow chart of the feature selection technique in machine learning used in this work is depicted in Figure 1.The algorithm is designed to gather the dataset containing the twenty-three input variables under consideration and perform necessary preprocessing, such as data cleaning and handling missing values.The RFE technique that iteratively removes the least important features based on the model's performance is used to select the top five most critical variables that will be further used by the fuzzy-based system.
Table 2 provides data on these input variables for the items under investigation, along with the duration of the milestone activity (output variable).Membership functions have been established for these inputs, representing criticality, item variants, market competition, procurement frequency, tender value and the output, which signifies scheduled procurement norms for a particular item or item group.The fuzzy rule base governing this process is outlined in Table 3. Triangular membership functions have been employed in this proposed approach due to their versatility and reliability.To illustrate the construction of a triangular membership function for "MEDIUM" under the input variable of buying frequency, consider the following parameters: the base values of the MEDIUM triangle are 2.5 and 11, with a peak value of 6.5.This triangular function can be expressed as follows (Equation ( 1)): x ≤ 2.5 x−2.5 4 , 2.5 ≤ x ≤ 6.5 11−x 5.5 , 6.5 where x= MEDIUM, in this case.The other triangles of the variables are so computed to form the input and output membership functions presented in Figure 2. The data range of the key variables are presented in Table 4.In this proposed work, the key input variables identified, namely, project criticality, variants, competition, buying frequency and tender estimate value, are converted into fuzzy sets with corresponding membership functions.For example, the variable "buying frequency per annum" is categorized into fuzzy sets like low, medium and high.A set of fuzzy rules is defined to describe the relationshipbetween input variables and the output (average procurement period).For instance, if project criticality is HIGH, the variants in the tender are MULTIPLE, the number of vendors competing in the tender is LOW, the buying frequency per annum is HIGH and the tender estimated value is HIGH, then the procurement duration is LONG.The fuzzy inference engine evaluates these rules using the fuzzified inputs to generate fuzzy outputs.This involves applying the fuzzy logic operations to determine the degree to which each rule is satisfied.Then, the results of all rules are combined to form a fuzzy set representing the output variable (average procurement period).The aggregated fuzzy output is then defuzzified using the centroid method.This involves computing the center of gravity of the fuzzy set to obtain a single crisp value representing the average procurement period.
where y* is the defuzzified (crisp) output value; y is a variable representing points in the domain of the output fuzzy set; µ B (y) is the membership function of the aggregated fuzzy output set.By using the centroid method for defuzzification, the proposal ensures that the average procurement period is accurately and reliably determined based on the most influential factors.This method provides a good balance between simplicity, efficiency and accuracy, making it an ideal choice for the fuzzy-based system proposed to optimize procurement processes.

Results and Discussion
The proposed system begins by effectively processing input parameters, transforming them into fuzzy sets.These fuzzy sets serve as the basis for subsequent computations that determine the output fuzzy set, aligning with the system's design.The input parameters under consideration include buying frequency, competition, criticality, tender value and variants.Each of these parameters plays a crucial role in shaping the procurement landscape and is graphically depicted in Figure 3, which provides visual representations of the input variables in relation to procurement norms.The variable "buying frequency" (Figure 3a) exhibits non-linear behavior with an intriguing quasi-linear relationship observed within the range of 1 to 6 for the tendered items.This suggests that there exists a critical threshold for buying frequency, beyond which the procurement period experiences a significant change.The variable "competition" (Figure 3b) illustrates a reduction in the procurement period when a substantial number of vendors participate in the tender process.This reduction is attributed to an intensified rate of competition, which, in turn, diminishes the justification required for item procurement.
In Figure 3c, the impact of inter-departmental follow-ups on the procurement process is evident.As the criticality level surpasses 15, a noticeable declining trend in the procurement period is observed.This underscores the importance of effective communication and coordination between departments to expedite procurement activities.Conversely, Figure 3d reveals that as the tender value exceeds 5 million rupees, the procurement period tends to increase.This counterintuitive relationship may be attributed to the complexity and scrutiny associated with high-value tenders, resulting in a longer procurement duration.The fifth input variable, the number of variants tendered, demonstrates a limited impact on the procurement period, with slight fluctuations occurring within the range of 6 to 12, as depicted in Figure 3e.This suggests that the number of variants, within a certain range, does not significantly alter the procurement timeline.The findings from the proposed fuzzy logic-based procurement system offer several practical implications for organizations, particularly those involved in complex procurement processes, like enhanced decision-making, identification of critical thresholds, improved coordination and communication, including optimization of procurement processes.
Accurate Procurement Duration Predictions: The system's ability to predict procurement durations with high accuracy, which allows procurement managers to make more informed decisions.Knowing the estimated time from purchase request to contract finalization helps in planning and scheduling procurement activities effectively.
Strategic Resource Allocation: By understanding the factors that most significantly influence procurement durations, organizations can allocate resources more strategically.For instance, they can prioritize resources for highcriticality items or those with high tender values, ensuring that these procurements are managed more efficiently.The findings from the proposed fuzzy logic-based procurement system offer several practical implications for organizations, particularly those involved in complex procurement processes, like enhanced decision-making, identification of critical thresholds, improved coordination and communication, including optimization of procurement processes.
Accurate Procurement Duration Predictions: The system's ability to predict procurement durations with high accuracy, which allows procurement managers to make more informed decisions.Knowing the estimated time from purchase request to contract finalization helps in planning and scheduling procurement activities effectively.
Strategic Resource Allocation: By understanding the factors that most significantly influence procurement durations, organizations can allocate resources more strategically.For instance, they can prioritize resources for highcriticality items or those with high tender values, ensuring that these procurements are managed more efficiently.
Threshold for Buying Frequency: The quasi-linear relationship identified for buying frequency (with a critical threshold observed between 1 and 6) indicates that beyond this range, significant changes in procurement duration can occur.Organizations can use this insight to optimize their procurement cycles, avoiding frequent small orders that could prolong the procurement period.
Impact of Competition: The finding that increased competition reduces procurement duration suggests that encouraging more suppliers to participate in tenders can expedite the process.Organizations might consider strategies to broaden their supplier base and foster competitive bidding environments.
Inter-Departmental Follow-Ups: Streamlining inter-departmental follow-ups and ensuring prompt responses can reduce delays, particularly for highcriticality items.
Complexity of High-Value Tenders: The observation that procurement periods increase with higher tender values (above 5 million rupees) underscores the need for meticulous planning and additional scrutiny for high-value procurements.Organizations can prepare for these complexities by allocating more time and resources to manage these tenders.
Handling Variants: The limited impact of the number of variants on procurement duration within a certain range (6 to 12) suggests that organizations can manage multiple variants without significant delays.This insight helps in planning bulk procurements where multiple variants are involved, ensuring that procurement timelines remain unaffected.
Resource Optimization: The ability to predict procurement durations accurately enables organizations to optimize their human, material and financial resources.This leads to more efficient operations, reduced wastage, and better financial management, particularly for critical projects requiring timely procurement.
To provide a comprehensive view of the relationships between various input combinations and their corresponding output, surface plots are presented in Figures 4-13.These plots offer a three-dimensional representation, allowing for a nuanced understanding of how different combinations of input parameters influence the procurement period.The surface plots highlight the intricate and often non-linear nature of these relationships, emphasizing the need for a sophisticated modeling approach like fuzzy logic to capture the nuances of the procurement process.Figure 4 shows the relationshipbetween the number of variants available in the scope of supply and the tender value.The plot helps to identify how different combinations of these two variables affect the procurement period, indicating that a higher number of variants might complicate the procurement process, especially when coupled with higher tender values.Figure 5 demonstrates how the frequency of procurement for a specific item interacts with the level of competition (number of suppliers).Understanding this relationship is crucial for optimizing procurement timelines, as frequent purchasing coupled with high competition may lead to quicker decision-making.The relationshipbetween the frequency of procurement and the criticality of the item is illustrated in Figure 6.This plot highlights how often critical items are procured and the impact of their criticality on the procurement process.High criticality and high buying frequency indicate a need for streamlined procedures.Figure 7 shows the interactionbetween buying frequency per annum and the tendered value.The visualization helps in understanding how frequent purchases of high-value items require different handling compared to lower-value items.The surface plot between competition and criticality shown in Figure 8 helps us to understand how the availability of suppliers (competition) affects the procurement of highly critical items.This relationship is key to identifying potential bottlenecks where high criticality might reduce supplier options, complicating the procurement process.Figure 9 shows the interactionbetween competition among suppliers and the tender value.This relationship apprises the strategies used to manage procurement in situations where high-value tenders are involved, especially when a lower number of suppliers are participating in the tender.Figure 10 illustrates how the criticality of an item affects tender value.It provides insight into how critical items might lead to higher tender values due to their importance in the project, which could, in turn, influence the procurement duration.Figure 11 depicts the relationshipbetween the number of available variants and how often the item is procured.It helps us to understand if items with more variants are procured more or less frequently and how this dynamic affects the overall procurement timeline.The plot between variants and competition shown in Figure 12 provides insight into how the availability of multiple variants influences the level of supplier competition.This is particularly useful for understanding procurement scenarios where a higher number of variants might either increase or decrease supplier competition.The surface plot shown in Figure 13 illustrates the relationshipbetween the number of variants and the criticality of the item.It is essential for understanding how multiple variants of a critical item are managed within the procurement process and whether this complexity adds to the procurement time.These visualizations also guide procurement professionals in understanding the key drivers of procurement time and in making more informed decisions.ment time.These visualizations also guide procurement professionals in understanding the key drivers of procurement time and in making more informed decisions.
The model's performance was rigorously assessed using datafrom 12 items, and the results are tabulated in Table 5.The RMSE of the fuzzy logic-based output is approximately 2.37, indicating a low average error between the actual and predicted values.Techniques such as data cleaning, normalization and handling of missing values were effectively applied, ensuring the input data was well-prepared for modeling for more precise predictions.The R² score is approximately 0.993, indicating that the model explains 99.3% of the variance in the procurement period, demonstrating a high level of accuracy.
These metrics validate the effectiveness of the fuzzy logic-based system in predicting the procurement period.The system demonstrated its capability to predict the duration required from purchase request to contract finalization with a high degree of accuracy.This underscores the efficacy of the fuzzy logic-based approach in capturing the complex and non-linear relationships inherent in procurement dynamics.The model's performance was rigorously assessed using datafrom 12 items, and the results are tabulated in Table 5.The RMSE of the fuzzy logic-based output is approximately 2.37, indicating a low average error between the actual and predicted values.Techniques such as data cleaning, normalization and handling of missing values were effectively applied, ensuring the input data was well-prepared for modeling for more precise predictions.The R 2 score is approximately 0.993, indicating that the model explains 99.3% of the variance in the procurement period, demonstrating a high level of accuracy.These metrics validate the effectiveness of the fuzzy logic-based system in predicting the procurement period.The system demonstrated its capability to predict the duration required from purchase request to contract finalization with a high degree of accuracy.This underscores the efficacy of the fuzzy logic-based approach in capturing the complex and non-linear relationships inherent in procurement dynamics.
Thus, the proposed fuzzy logic-based procurement system proves to be a robust framework for modeling and predicting the duration required from purchase request to contract finalization.Visual representations of key input variables, along with surface plots, offer valuable insights into the complex relationships governing the procurement process.The findings highlight non-linear and quasi-linear behaviors within specific parameter ranges, shedding light on critical thresholds and influencing factors.The system's performance assessment using real-world data further validates its effectiveness in capturing the intricacies of procurement management.As organizations continue to seek innovative solutions for efficient procurement, the integration of fuzzy logic systems emerges as a promising avenue for addressing the inherent uncertainties and complexities in this domain.
This fuzzy-based prediction system offers organizations the means to optimize their human, material and financial resources, contributing to more efficient operations and decision-making.

Conclusions
In this paper, we explore the application of artificial intelligence to enhance supply chain management by determining an optimal procurement norm for estimating the duration from purchase request to contract finalization of a boiler component.The integration of RFE allowed us to systematically select the most influential features, enhancing the accuracy and efficiency of the model.Fuzzy logic, on the other hand, enabled the handling of uncertainty and non-linear relationships within the data, providing a more robust and adaptable solution.The implementation of such AI-driven systems could represent a significant step forward in the evolution of supply chain management, offering substantial benefits in terms of cost savings, time efficiency and strategic decision-making.
Our investigation revealed a quasi-linear relationship between the buying frequency of tendered items within the range of 1 to 6.Moreover, when a significant number of vendors participate in a tender, it leads to a reduction in the procurement period.Notably, inter-departmental collaboration was found to expedite the procurement process, resulting in a decreasing trend in the procurement period when the criticality level exceeded 15.Conversely, as the tender value exceeded 5 million rupees, the procurement period tended to increase.
To provide a comprehensive view of the relationships between these variables, we present a surface plot that captures the overall variations within the selected framework.The results obtained from our developed system were evaluated against real-time cases, demonstrating a high degree of agreement.This fuzzy decision-making tool holds promise for various supply chain functions across industries, offering opportunities for improvement in their operational activities.Future research could explore the application of this model to other components or industries, as well as integrate additional variables, such as market dynamics or geopolitical factors, to further refine the accuracy and utility of the tool.

Figure 2 .
Figure 2. (a-e) Input membership functions and (f) output membership function.

Table 1 .
Purchase request to contract finalization duration in days.

Table 2 .
Input and output variables in procurement.

Table 3 .
Logic table used in the system.

Table 4 .
Data range of the key variables.

Table 5 .
Tested sample cases and results.

Table 5 .
Tested sample cases and results.