This project contains a system that manages the electricity supply of a whole locality using concepts of C++ like data strcture, dynamic programming e.t.c several other programming techniques.
All the drawbacks of currently applied methods for an electricity supply system indicate a clear problem with space complexity. In order to solve this problem, efforts including: dynamic, recursive, and several other programming techniques have been used and most of them properly solve the problem of space complexity. Implementation of these lesser time complex methods to the problem in a more user-friendly and sophisticated manner is the purpose of this project.
The project works upon the idea of dynamic programming. As stated above, the disadvantages of using a model program that stores data linearly and with a fixed space predefined without taking the user’s demands into consideration are the ultimate advantages of this program. The program uses a fixed format for every type of data that is to be entered; for example the structure cust_info_node is the basic data format used for any customer that is added to the database. When a new customer is to be added, the program simply calls this data format and some functions that allocate space in memory for the new customer and adds this as a node to a standard list of other customers associated with the same retailer. In this way, we avoid the need for a predefined number of customers and also eliminate the requirement of a certain (generally huge) amount of data, i.e. it gives us the capability of adding the maximum possible amount of data in data space with limited storage space. The proposed program uses a linked list as the primary data type. In the program, the board administrator has the rights to the addition of a node to the linked list of retailers and also has rights to add a node to the linked list of customers associated with a certain retailer. In this way, the retailer or the customer cannot abuse right to add or access details to any of the lists since this right isn’t granted to them. The program is also integrated with a fool-proof mechanism for logging in to any of the user types. This is implemented by integrating the logging-in mechanism into an infinite while loop with condition that only gets satisfied upon successful user name and password match. The program runs with simpler loops than that required in programs with linear and fixed data type implementation. It thus performs quicker searches in the bulk of the data and also has a O(1) time to include data node to the list. The searching function follows the routine:
current_node=start-of(list_of_customers) While: current_node→link!=NULL Check IF current_node→data == required_data Then Print current_position Else current_node=current_node→next
As we can observe from this routine, the current_node is the node that will traverse the list several times and during this traversal of the list, many values can be estimated and functions can be called. Some key factors like this make this program better at running than most other types of programs that manage data of similar kinds.