DSAA204/BIT204: Inventory System Report and Algorithm Analysis

Verified

Added on  2022/11/01

|17
|3245
|422
Report
AI Summary
This report details the design of an inventory system for a company dealing with household and food items. It explores the selection of variables, keys, and ranges for two databases. The report justifies the choice of quicksort for sorting and linear search for searching, providing pseudocode examples. It also proposes improvements using heap sort and binary search algorithms to enhance efficiency, particularly for larger datasets. The analysis covers inventory operations, optimization techniques, and the importance of efficient algorithm selection for optimal system performance. The report concludes by emphasizing the significance of a well-managed inventory system and the benefits of the chosen and proposed algorithms.
Document Page
Running head: DATA STRUCTURE AND ALGORITHM
DATA STRUCTURE AND ALGORITHM
Name of the Student
Name of the University
Author Note
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
1DATA STRUCTURE AND ALGORITHM
Executive Summary
This report discusses the regarding the two different inventory systems. It elaborates how the
several operations in that inventory systems needs to be performed. It discusses the searching
and sorting algorithms performed in this type of inventory systems. This assignment illustrates
different innovative techniques for the optimization of the inventory systems. This report
elaborates the proposed changes in the algorithm of searching as well as sorting category. This
report concludes that how algorithm can improve the changes the inventory systems.
Document Page
2DATA STRUCTURE AND ALGORITHM
Table of Contents
Introduction......................................................................................................................................3
Discussion........................................................................................................................................3
Choice of variables, keys and ranges...........................................................................................3
Choice of the algorithm for searching and sorting......................................................................6
Justification for choosing the algorithm for each operation........................................................6
Proposed changes.........................................................................................................................9
Conclusion.....................................................................................................................................12
Document Page
3DATA STRUCTURE AND ALGORITHM
Introduction
This report discusses choosing exact variables, keys, and ranges that have used in that
system. This assignment provides the required justification related to this matter (Bestle, Abbas
and Rui 2014). It describes several operations that are required for the efficient performance of
the system (Aumüller and Dietzfelbinger 2016). The efficient sorting and searching algorithm
needs to be implemented for performing this operation. It provides the proper justification of the
chosen algorithm and also the proposed modification of those algorithms.
Discussion
Choice of variables, keys and ranges
The variables used for the household database are prodtype, prodname, prodprice,
prodmanufacturer (Bestle, Abbas and Rui 2014). The variable used for food items database is
fdtype, fdname, fdprice, fdmanufacturer, fdexpiry.
The data type of prodtype is varchar2(20). The data type of prodname is varchar2(20).
The data type of prodprice and prodmanufacturer is respectively integer and varchar2(20). In
case of food database the data type for fdtype is varchar2(20) (Bogdanov, Laur and Talviste
2014). The data type of fdname is varchar2(20). The data type of fdprice is integer. The data type
for fdmanufacturer is varchar2(20). The data type for fdexpiry will be date. The primary key of a
household item is prodtype (Hansen and Narayanan 2013). The primary key for food items will
be fdtype. The range of the prodname prodtype, prodprice and prodmanufacturer is three
hundred. It is because; there are three hundred types of household items manufactured by the
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
4DATA STRUCTURE AND ALGORITHM
company. The range of all the attributes of food item are two hundred. It is because there are two
hundred foods items produced by the company.
Supporting Inventory operations
The operations required for inventory systems include the insertion, update, deletion of
all the household items as well as food items (Heineman, Pollice and Selkow 2016). For
smoothly running the inventory systems, the company needs to perform some inventory
operations — the five inventory optimization for best practices.
The company needs to categorize the inventory
The management segregates its inventory as per the value and speed of the
income (Heineman, Pollice and Selkow 2016). The company can use different
types of inventory software to track the demands of the household as well as food
items. It is used to refill some practices.
Refilling of technology
The inventory system must be coupled with the optimization software that can
enable the company to successfully track the different levels and produce some
unexpected outcomes (Kushagr et al. 2014). By using this overstocking as well as
under stocking situation can be avoided.
Performing regular improvement
The company investigates several operational challenges (Mahafzah 2013). It
involves huge expenditure due to operations and also getting the worst customer
service.
Designing an efficient forecast model
Document Page
5DATA STRUCTURE AND ALGORITHM
Increase in forecast model is main reason to know when increase or reduction of
level of database items based on the modification of the activity of purchasing.
The company needs to judge the feedback mechanism for the demand of the
consumer (Mirjalili, Mirjalili and Hatamlou 2016). The company should ensure
that they have the clear understanding of the outcome of these activities and most
amount of purchase in holidays. There must have the clear communication
channels between those persons who are responsible for perform interpretation of
data. It helps with exact amount of forecasting mechanism (Neininger 2015). The
collection of information from different portions of the supply chain. These
include suppliers, manufacturers and many others.
Evaluation of the inefficiencies of the database
There are several different ways to modify expenditure of inventory
management. The stock is stored in the database or with the third party company
(Boticki et al. 2013). If the methodology for storing data element is rigid the
layout will be very much efficient. It will provide the current methodology for
tracking the discount provided by the company for making orders at exact times
(Rahim et al. 2017). It is used when the inventory systems may be less reliable
than other inventory systems.
Continuously reevaluate the supply chain and logistics
Company should perform some continuous methodology to perform the review
of the internal procedures as well as the performance of the inventory system
(Sedgewick and Flajolet 2013). They can perform the maintenance of
expenditure at the perfect level in a long-term basis (Neininger 2015).
Document Page
6DATA STRUCTURE AND ALGORITHM
Evaluation must be performed by using the circumstances of the KPI related to
the industry. This can be done by calculating the performance of the
organization as well as experimentation of other rival company. The daily
presentation of couriers and delivery service can able to maintain the total
expenditure of the inventory systems.
Choice of the algorithm for searching and sorting
The best algorithm for sorting is Quick sort. The best algorithm for searching is a linear
search.
Justification for choosing the algorithm for each operation
A quick sort algorithm is faster than another sorting algorithm. The best-case time
complexity of this algorithm is O(nlogn). It is because for huge values of n the execution time for
this algorithm detonates. This algorithm is cache-friendly. The original running time of this
algorithm is O(nBlog(nB)). The letter B is referred to as block size. The reason for becoming it
cache-friendly is that it can able to scan the data linearly (Sedgewick and Flajolet 2013). It can
able to segregate the input linearly. In every loading of cache for quicksort, the cache loading is
done for the reading of information. This algorithm provides an outstanding performance of
cache at every level of cache. That is why it is called a cache-oblivious. Quicksort can make a
huge amount of recursive calls, but it allocates less number of spaces available in the stack. The
programmer can re-use that space (Rahim et al. 2013). This algorithm is very much sensitive to
the given input. In each case, it requires some amount of swaps. Other sorting algorithms do not
provide the optimal solution like quicksort.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
7DATA STRUCTURE AND ALGORITHM
. The quick sort algorithm for household items will be as follows:
(i) Determine the pivots that divide that array into two parts
(ii) Perform the quick sort for the left half.
(iii) Perform the quick sort for right half.
Pseudo code for quick sort:
int partition(int arr[], int low, int high)
{
int pivot = arr[high];
int i = (low-1); // index of smaller element
for (int j=low; j<high; j++)
{
if (arr[j] <= pivot)
{
i++;
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
int temp = arr[i+1];
Document Page
8DATA STRUCTURE AND ALGORITHM
arr[i+1] = arr[high];
arr[high] = temp;
return i+1;
}
In this case, a linear search algorithm is applicable. It is because this algorithm is
appropriate for unsorted data. The methodology of this algorithm is very much simple. The
coding of this algorithm is very simple (Boticki et al. 2013). The length of the code is also
smaller. This rule is called the KISS principle. As this system has very less amount of data
structures, that is why this algorithm is the correct choice for this.
The linear search algorithm:
1. i=0
2. if i>n then go to step 7
3. If A[i]=x, go to step 6
4. i=i+1.
5. Go to step 2
6. Print element x found at i
7. Print element not found
8. Exit
Pseudo code for linear search -
1. variable declaration ( int c, n, search, array[])
2. Scanner class is defined to scan the user input
3. n = in.nextInt();
Document Page
9DATA STRUCTURE AND ALGORITHM
4. array = new int[n];
5. Print Statement to display the input("Enter those " + n + " elements");
6. for loop is created to run the program n number of times, where n is user-input
7. array[c] = in.nextInt();
8. user input for searching the desired element("Enter value to find");
9. search = in.nextInt();
10.
11. for (c = 0; c < n; c++)
12. {
13. if (array[c] == search)
14. {
15. System.out.println (search + " is present at location " + (c + 1) + ".");
16. break;
17. }
18. }
19. if (c == n) /* Element to search isn't present */
20. System.out.println (search + " isn't present in array.");
21. }
22. }
Proposed changes
The improvement can be performed by using the heap sort. It is a special kind of binary
tree where the root-node is compared to its child and must be arranged accordingly. There are
two types of the heap (Neininger 2015). This includes Min heap and max heap. In the case of
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
10DATA STRUCTURE AND ALGORITHM
Min heap, the parent node is less than or equal to its children. In the case of Max heap, the parent
node is greater than or equal to its children. The Max-heap can be created as follows:
Create a new node in a heap.
Assign a value from the household items from the node.
Compare the value of the child node with the parent node.
If the value of the parent is lesser than the child node, then swap the value.
Repeat steps three and four until the property of heap satisfies.
Pseudo code for max heap will be as follows:
HEAP-SORT (A)
1. Build-Max-Heap(A)
2. for i=length[A]downto2
3. exchange A[1] and A[i]
4. heap-size[A]←heap-size[A]−1
5. Max-Heapify (A,1)
HEAP-EXTRACT-MAX (A)
1. max←A[1]
2. A[1]←A[heap-size[A]]
3. heap-size[A]←heap-size[A]−1
4. Max-Heapify(A,1)
5. return max
MAX-HEAP-INSERT (A, key)
1. heap-size[A]←heap-size[A] + 1
Document Page
11DATA STRUCTURE AND ALGORITHM
2. A[heap-size[A]]←−∞
3. Heap-Increase-Key(A[heap-size[A]], key)
The improvement is performed by using the binary search algorithm instead of a linear
search (Kushagra et al. 2014). Binary search is very much efficient for the databases to contain
massive elements. The database must have the elements having the numerical key (Mirjalili,
Mirjalili and Hatamlou 2016). The algorithm will initiate at the middle element of the given two
databases (Ogbo and Ukpere 2014). If the target element is greater than the element positioned at
the middle position the search will continue from the lower portion of those two databases. This
procedure will continue its operation until it finds the desired element (Mahafzah 2013). It will
also remove a half portion of those two databases. This procedure is very much faster than the
linear search approach (Sedgewick and Flajolet 2013). It is more complex than a linear search
approach. This algorithm is very much efficient for the databases having a huge number of
elements. It operates in contiguous locations. It has a specific number of left as well as the right
indexes (Kushagra et al. 2014). This is called as search space. Binary search maintains right, left
as well as middle indices of the search space. It compares the target element of searching or
applies the condition of the middle value of the collection (Heineman, Pollice and Selkow 2016).
If the conditions are not satisfied or the value is not equal, the half portion of the array will
eliminate (Hansen and Narayanan 2013). If the condition will be terminated at the empty half
portion, the condition is not satisfied, and the goal is not detected.
Pseudo code for Binary search will be as follows:
Binarysearch(list[], min, max, key)
chevron_up_icon
1 out of 17
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]