I'm pursuing an algorithms course and currently we're learning network flow algorithms and hence naturally, we'll be dealing with graphs.
The issue I'm facing is with an assignment question that we've recieved, where we're supposed to implement the ford-fulkerson algorithm. The input parameters seem very bizzare for creating the graph to perform the algorithm on- for instance, here is a sample input test case
{Here, N is the number of vertices and M is the number of edges}
N = 5, M = 4
Starting vertex = 1
Ending vertex = 5
Edges[]= {{1,2,1},{3,2,2},{4,2,3},{2,5,5}}
It is the last line that confuses me. What representation of a weighted graph exactly is this? I've tried looking this up online but everyone just uses adjacency matrices.
As I've mentioned, I'm not able to understand how we go about inputting a graph here with this bizarre input format.
Thank you in advance