DSA Report
DSA Report
BACHELOR OF TECHNOLOGY
In
COMPUTER SCIENCE ENGINEERING
With specialization in Information Technology
PROJECT REPORT ON “Cash Flow Minimizer using Graphs”.
Submitted by
BORRA YASWANTH[RA2211030010262]
P.LAXMINARAYANA[RA2211030010258]
Certified that this project report titled “Cash Flow Minimizer using Graphs” is
the Bonafede work done by “BORRA YASWANTH” [RA2211030010262],
“P.LAXMI NARAYANA” [RA2211030010258], and “A.V HARSHA
VARDHAN” [RA22211030010249], and “J.JEEVA RATHNAM
REDDY”[RA2211030010253]. who carried out this project under my
supervision. Certified further, that to the best of my knowledge the work reported
herein does not form part of any other work.
SIGNATURE
Dr. Pandimurugan V
DSA – Course Faculty
Assistant Professor
Department of Network and Communication
CONTENT TABLE:
S.NO TOPIC PG NO.
1 Project Statement 1
2 Product Description 1
3 Why Do It 2
7 Approach 4
8 pseudocode 5
9 Complexity Analysis 8
11 Code 12
12 Output 14
13 Conclusion 15
PROBLEM STATEMENT:
The problem of "Cash Flow Minimization" pertains to the efficient management and
optimization of cash flows within an organization or financial entity. This involves controlling
the movement of funds to ensure a balance between incoming and outgoing cash, ultimately
reducing financial risk and maximizing liquidity. The primary objective is to minimize the
impact of cash flow disruptions or shortfalls and to enhance financial stability.
PRODUCT DESCRIPTION:
This system minimizes the number of transactions among multiple banks in different corners of
the world that use different modes of payment. There is one world bank (with all payment
modes) to act as an intermediary between banks that have no common mode of payment.
1
WHY DO IT:
A cash flow minimizer for banks is crucial to maintain financial stability. It's
designed to minimize the risk of liquidity shortages, ensuring that banks can meet
their short-term obligations. This is vital for daily operations and to prevent
financial crises. By carefully managing cash flow, banks can optimize their
resources, reduce the need for emergency borrowing, and maintain the public's trust.
It's a proactive measure to prevent insolvency, which can have far-reaching
economic consequences. In a nutshell, a cash flow minimizer is an essential tool for
banks to safeguard their financial health and contribute to overall
economic stability.
A graph is a data structure that stores connected data. In other words, a graph G (or
g) is defined as a set of vertices (V) and edges (E) that connects vertices. Examples
of graph are social Media network, computer network, Google Maps, etc.
Each graph consists of edges and vertices (also called nodes). Each vertex and edge
have a relation. Where vertex represents the data and edge represents the relation
between them. Vertex is denoted by a circle with a label on it. Edges are denoted by
a line that connects nodes (vertices).
2
ALGORITHM USED IN THIS PROJECT:
A greedy algorithm makes locally optimal choices at each step, hoping to find a
global optimum. It's efficient but not always guaranteed to provide the best
solution. The algorithm starts with an empty solution and repeatedly adds the best
available option. In each step, it chooses the most advantageous choice, often
based on a heuristic. Greedy algorithms problems where considering the entire
solution space is necessary to find the best outcome.
Used to Solve Optimization Problems: Graph - Map Colouring, Graph - Vertex Cover, Knapsack
Problem, Job Scheduling Problem, and activity selection problem are classic optimization
problems solved using a greedy algorithmic paradigm.
3
How does Greedy Algorithm work?
Greedy algorithms take all the data in a particular problem, and then set a rule for
which elements to add to the solution at each step of the algorithm. In the
animation above, the set of data is all the numbers in the graph, and the rule was
to select the largest number available at each level of the graph.
APPROACH:
This code minimizes cash flow among multiple banks by optimizing transactions.
It starts by calculating the net amounts for each bank based on incoming and
outgoing transactions. Then, it iteratively identifies the bank with the most
negative net amount and one with the most positive net amount that share a
common payment type. These banks engage in a transaction to reduce their net
amounts. If no common type is found, the world bank is involved to facilitate the
exchange. The process continues until all banks have zero net amounts. The code
uses a combination of data structures and algorithms to minimize cash flow
efficiently and outputs the transactions for minimum cash flow.
4
PSEUDOCODE:
- Iterate through listOfNetAmounts and find the bank with the minimum
netAmount that is not zero.
- Iterate through the ansGraph to print the transactions for minimum cash flow
between banks.
6
- Calculate the net amount of each bank in listOfNetAmounts.
- Find a bank with the maximum net amount (maxIndex) and a common
payment type with minIndex.
7
- Create a graph to represent transactions.
Complexity Analysis:
● Time complexity: O(numBanks^3*maxNumTypes).
This method is hence discarded cause it takes too much time, hence, for this
project we want to perform Greedy Algorithm method to Minimize Cash Flow.
8
ADVANTAGES OF GRAPH:
8. Integration: These tools can integrate with financial software and systems,
streamlining data input and providing a seamless cash flow management process.
10
DISADVANTAGES OF Graph:
1. Complexity: Graph-based cash flow minimizers can become complex for larger
financial systems, making them difficult to manage and maintain.
2. Data Dependency: They rely heavily on accurate and up-to-date financial data,
and any discrepancies or errors in data can lead to incorrect results.
11
8. Cost: Developing and maintaining graph-based solutions can be costly in terms
of software development, data integration, and ongoing support.
9. Risk of Errors: Errors in the design or implementation of the graph model can
lead to significant financial risks, which can be hard to identify and mitigate.
CODE:
12
13
OUTPUT:
14
CONCLUSION:
In conclusion, the provided code offers a robust "Cash Flow Minimizer System" for optimizing
financial transactions among multiple banks. It efficiently addresses the challenge of
minimizing the number of transactions when banks employ different payment modes without a
common type. The code's core functionality, which includes bank information input,
transaction details, and algorithm-driven optimization, streamlines complex financial
operations. Notably, the inclusion of a "World Bank" as an intermediary simplifies transactions
without common payment types, making it versatile and adaptable for diverse financial
scenarios. This code serves as a valuable tool for both international and local financial
institutions, enhancing the efficiency of transaction settlements while reducing operational
costs.
15