
weighted graph
A weighted graph is a mathematical structure consisting of points (called nodes or vertices) connected by lines (called edges). Each edge has a number (called a weight) assigned to it, which can represent cost, distance, or strength of connection. This allows the graph to show not just how points are connected but also the significance or cost of each connection. Weighted graphs are used in scenarios like routing, network optimization, and representing relationships where the strength or cost varies between different pairs of points.