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

前端 未结 12 1995
迷失自我
迷失自我 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:06

    There can be as many as n(n-1)/2 edges in the graph if not multi-edge is allowed.

    And this is achievable if we label the vertices 1,2,...,n and there's an edge from i to j iff i>j.

    See here.

    0 讨论(0)
  • 2020-12-07 18:09

    In a directed graph having N vertices, each vertex can connect to N-1 other vertices in the graph(Assuming, no self loop). Hence, the total number of edges can be are N(N-1).

    0 讨论(0)
  • 2020-12-07 18:09

    Can also be thought of as the number of ways of choosing pairs of nodes n choose 2 = n(n-1)/2. True if only any pair can have only one edge. Multiply by 2 otherwise

    0 讨论(0)
  • 2020-12-07 18:11

    If the graph is not a multi graph then it is clearly n * (n - 1), as each node can at most have edges to every other node. If this is a multigraph, then there is no max limit.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-07 18:12

    Undirected is N^2. Simple - every node has N options of edges (himself included), total of N nodes thus N*N

    0 讨论(0)
提交回复
热议问题