  How can graph theory be applied to investing in the stock market? The answer
may help investors realize the true risks of their investments, help prevent
recessions like that of 2008, and increase financial literacy amongst students.
Using several original Python programs, we take a correlation matrix with
correlations between the stock prices and then transform that into a graphable
binary adjacency matrix. From this graph, we take a graph in which each edge
represents weak correlations between two stocks. Finding the largest complete
graph will produce a diversified portfolio. Numerous trials have shown that
diversified portfolios consistently outperform the market during times of
economic stability, but undiversified portfolios prove to be riskier and more
unpredictable, either producing huge profits or even larger losses.
Furthermore, once deciding among which stocks our portfolio would consist of,
how do we know when to invest in each stock to maximize profits? Can taking
stock price data and shifting values help predict how a stock will perform
today if another stock performs a certain way n days prior? It was found that
this method of predicting the optimal time to investment failed to improve
returns when based solely on correlations. Although a trial with random stocks
with varied correlations produced more profits than continuously investing.
