A weighted graph is a type of graph which replaces the edges (or directed edges) with weighted edges. Weighted graphs can be either undirected or directed depending on the use case.