0% found this document useful (0 votes)
99 views18 pages

DSA Report

This document describes a project report submitted by 4 students for their Bachelor of Technology degree in Computer Science Engineering. The project aims to minimize cash flow among multiple banks using a greedy algorithm approach. It involves calculating the net amounts for each bank, identifying the bank with the most negative amount and one with a positive amount that share a payment type, and facilitating a transaction between them. This process is repeated until all banks have zero net amounts. The algorithm and code developed uses data structures like graphs to efficiently minimize cash flow among banks in the network.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views18 pages

DSA Report

This document describes a project report submitted by 4 students for their Bachelor of Technology degree in Computer Science Engineering. The project aims to minimize cash flow among multiple banks using a greedy algorithm approach. It involves calculating the net amounts for each bank, identifying the bank with the most negative amount and one with a positive amount that share a payment type, and facilitating a transaction between them. This process is repeated until all banks have zero net amounts. The algorithm and code developed uses data structures like graphs to efficiently minimize cash flow among banks in the network.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

SCHOOL OF COMPUTING

COLLEGE OF ENGINEERING AND TECHNOLOGY SRM


INSTITUTE OF SCIENCE AND TECHNOLOGY
KATTANKULATHUR - 603203
NOVEMBER 2023
In partial satisfaction of the requirements for the degree of

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]

A.V HARSHAVARDHAN [RA2211030010249]

J.JEEVA RATHNAM REDDY[RA2211030010253]

Under the Guidance of - Dr. Pandimurugan V

Assistant Professor, Department of Network and Communication

SRM INSTITUTION OF SCIENCE AND TECHNOLOGY


KATTANKULATHUR-603203
BONAFIDE CERTIFICATE

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

4 The algorithm used in the Project 3

5 What is Greedy Algorithm 3

6 Why was Greedy Algorithm Selected 4

7 Approach 4

8 pseudocode 5

9 Complexity Analysis 8

10 Advantages and Disadvantages 9

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.

Data structure used:

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:

THE PROJECT USES GREEDY ALGORITHM:

A greedy algorithm is a computer science algorithm that solves problems in the


shortest time possible. It works by selecting the best option available at the
moment.

What is GREEDY ALGORITHM:

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.

When to use a GREEDY ALGORITHM?

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:

1. Create a class 'bank' with attributes name, netAmount, and types.

2. Define a function getMinIndex(listOfNetAmounts[], numBanks):

- Initialize min to INT_MAX and minIndex to -1.

- Iterate through listOfNetAmounts and find the bank with the minimum
netAmount that is not zero.

- Update min and minIndex accordingly and return minIndex.

3. Define a function getSimpleMaxIndex(listOfNetAmounts[], numBanks):

- Initialize max to INT_MIN and maxIndex to -1.


5
- Iterate through listOfNetAmounts and find the bank with the maximum
netAmount that is not zero.

- Update max and maxIndex accordingly and return maxIndex.

4. Define a function getMaxIndex(listOfNetAmounts[], numBanks, minIndex,


input[], maxNumTypes):

- Initialize max to INT_MIN, maxIndex to -1, and matchingType to an empty


string.

- Iterate through listOfNetAmounts and find a bank with a positive netAmount


that shares a common payment type with the bank at minIndex.

- Update max, maxIndex, and matchingType accordingly and return a pair of


maxIndex and matchingType.

5. Define a function printAns(ansGraph, numBanks, input[]):

- Iterate through the ansGraph to print the transactions for minimum cash flow
between banks.

6. Define a function minimizeCashFlow(numBanks, input[], indexOf,


numTransactions, graph, maxNumTypes):

6
- Calculate the net amount of each bank in listOfNetAmounts.

- Initialize a 2D ansGraph to represent the transactions.

- Iterate until all banks have a net amount of zero:

- Find the bank with the minimum net amount (minIndex).

- Find a bank with the maximum net amount (maxIndex) and a common
payment type with minIndex.

- Determine the transaction amount and update the ansGraph accordingly.

- Update the netAmounts of minIndex and maxIndex.

- Call printAns to display the minimized cash flow transactions.

7. In the main function:

- Initialize variables and input data from the user.

7
- Create a graph to represent transactions.

- Call minimizeCashFlow to minimize cash flow among banks.

Complexity Analysis:
● Time complexity: O(numBanks^3*maxNumTypes).

● Space Complexity: O(numBanks^2).

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:

1. Modelling Complex Relationships: Project cash flow often involves numerous


interrelated variables, such as expenses, revenues, and dependencies. Graphs can
effectively model these complex relationships, enabling a comprehensive
understanding of how different factors impact the project's financial health.

2. Visualization: Graphs provide a visual representation of financial dependencies,


making it easier to identify critical paths and potential cost-saving opportunities.
This visualization aids in decision-making and communication with stakeholders.

3. Efficient Algorithmic Solutions: Graph algorithms like shortest path and


maximum flow can be applied to optimize cash flow. For instance, finding the
shortest path in a cash flow graph can help determine the most cost-effective way
to meet financial obligations and minimize delays.

4. Sensitivity Analysis: Graphs allow for sensitivity analysis, helping project


managers assess the impact of changes in variables (e.g., delays, cost adjustments)
on cash flow. This helps in risk assessment and proactive management.

5. Resource Allocation: Graphs can be used to allocate resources optimally,


ensuring that funds are allocated to critical project activities in a way that
minimizes cash flow bottlenecks.

6. Scalability: Graph-based cash flow minimizers can handle projects of varying


sizes and complexities, from small-scale initiatives to large-scale endeavors,
making them adaptable to different scenarios.

7. Real-time Monitoring: Graph-based tools can offer real-time monitoring and


9
alerts, enabling project managers to respond promptly to cash flow issues and
prevent financial crises.

8. Integration: These tools can integrate with financial software and systems,
streamlining data input and providing a seamless cash flow management process.

9. Risk Mitigation: By identifying potential cash flow bottlenecks and their


consequences, project managers can proactively take measures to mitigate
financial risks and ensure project success.

10. Data-Driven Decision Making: Graph-based cash flow minimizers enable


data-driven decision-making, enhancing the precision and predictability of
financial outcomes.

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.

3. Limited Real-World Factors: Graph models may oversimplify real-world


financial complexities, such as changing market conditions, regulatory changes, or
unexpected events.

4. Computational Intensity: Solving complex graph-based models can be


computationally intensive, requiring significant processing power and time.

5. Lack of Transparency: Understanding the exact logic and decision-making


process of a graph-based cash flow minimizer can be challenging, potentially
leading to a lack of transparency in financial planning.

6. Resistance to Change: Adapting a graph-based approach to changing business


needs or financial strategies can be inflexible and time-consuming.

7. Expertise Required: Implementing and maintaining graph-based cash flow


minimizers may require specialized knowledge and expertise, which may not be
readily available.

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.

10. Integration Challenges: Integrating a graph-based cash flow minimizer with


existing financial systems and software can pose challenges and require additional
development efforts.

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

You might also like