<｜begin▁of▁sentence｜>### Instruction:
As a financial analyst, you have a network of 5 investment opportunities, each with 6 different financial metrics indicating their relationship. How would you go about identifying and displaying the most influential connections among these opportunities?
### Response:
import igraph as ig

# Create a weighted graph with 5 vertices and 6 edges
edges = [(0, 1), (0, 2), (1, 3), (1, 4), (2, 3), (3, 4)]
weights = [1, 5, 3, 2, 4, 1]
g = ig.Graph(edges=edges)
g.es['weight'] = weights

# Calculate the minimum spanning tree
mst = g.spanning_tree(weights=g.es['weight'])

# Print the MST edges
print(mst.get_edgelist())

# For comparison, here's how you would do it in networkx
import networkx as nx

# Creating the same weighted graph
G = nx.Graph()
G.add_weighted_edges_from([(0, 1, 1), (0, 2, 5), (1, 3, 3), (1, 4, 2), (2, 3, 4), (3, 4, 1)])

# Finding the minimum spanning tree using networkx
mst_nx = nx.minimum_spanning_tree(G)

# Print the MST edges from networkx
print(sorted(mst_nx.edges(data=True)))
<|EOT|>
