What is the maximum number of edges in a directed graph with n nodes?

前端 未结 12 2045
迷失自我
迷失自我 2020-12-07 17:13

What is the maximum number of edges in a directed graph with n nodes? Is there any upper bound?

12条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 18:11

    The correct answer is n*(n-1)/2. Each edge has been counted twice, hence the division by 2. A complete graph has the maximum number of edges, which is given by n choose 2 = n*(n-1)/2.

提交回复
热议问题