Create a new adjacency-list Adj of size |V| and an empty matrix M of size |V|^2 first. For each vertex u in the multigraph G, we iterably examine each vertex v of Adj[u].
•If M(u, v) == ∅, mark M(u, v) true, then add v to Adj[u]
•If M(u, v) == true, do nothing.
Since we lookup in the adjacency-list Adj for |V + E| times, the time complexity is O(V + E).
▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪
EQUIVALENT-UNDIRECTED-GRAPH
let Adj'[1..|V|] be a new adjacency-list
let M be |V| × |V|
for each vertex u ∈ G.V
for each v ∈ Adj[u]
if M[u, v] == Ø && u != v
M[u, v] = true
INSERT(Adj'[u], v)