Densidade grafo
- Created by
- Renato Passos, Eng. de Software
- Reviewed by
- Renato Passos, Eng. de Software
Last updated: Apr 18, 2026
About this calculator
The graph density calculator computes the density of an undirected graph, showing how many edges exist compared to the maximum possible. The formula used is 2E/(V(V−1)), where E is the number of edges and V the number of vertices. This metric is crucial for network analysis, graph theory, and connectivity studies in complex systems.
To use the calculator, input the edges and vertices values. The result indicates the proportion of edges relative to the theoretical maximum (V(V−1)/2). A density of 1 means a complete graph, while values near 0 suggest sparse graphs. The calculation assumes no loops or multiple edges between the same pair of vertices.
This tool is useful for social network analysis, transportation models, or optimization algorithms. For example, in urban connectivity studies, density can reveal whether a city has evenly distributed infrastructure. Note: For directed graphs, the formula changes to E/(V(V−1)), as each edge has a direction.
Invalid values (like E > V(V−1)/2) will trigger an error, as no graph can have more edges than the theoretical maximum. Validate inputs before calculating. Density helps compare graphs of different sizes by normalizing edge count relative to graph scale.
Frequently asked questions
What is graph density?
It's a metric comparing existing edges to the theoretical maximum in a graph, calculated as 2E/(V(V−1)) for undirected graphs.
How does the 2E/(V(V−1)) formula work?
Multiply edges (E) by 2 and divide by the product of vertices count (V) and possible connections (V−1).
When should I use this calculator?
To analyze connectivity in social networks, transportation models, or compare efficiency in systems with graph structures.
What if my graph has directed edges?
The formula changes to E/(V(V−1)) since directed edges count as unique pairs. Use a calculator for directed graphs instead.
Why can't the result exceed 1?
Because 1 represents a complete graph where all vertices are interconnected. Values above 1 are mathematically impossible.