Skip to content

IsCompleteGraph ​

Whether a Graph is complete — every pair of vertices joined by an edge.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageCompleteGraphQ✓
IsCompleteGraph(g)true iff g is simple (no self-loop, no parallel edge) and every ORDERED pair of distinct vertices is joined.
Typed signatures
TypePackageApplies
(value) -> booleancombinatoricsalways

Domain: Collections

Details
  • Wolfram calls this CompleteGraphQ; this library uses the Is… spelling everywhere.
  • A directed graph counts too, kernel-verified against Wolfram 15: CompleteGraphQ(Graph({1->2, 2->1})) is True, and CompleteGraph(3, DirectedEdges->True) (every ordered pair, both directions) is complete. An undirected edge covers BOTH ordered pairs between its endpoints; a directed edge covers only the one it points.

Examples

Basic #
live ↗
InIsCompleteGraph(CompleteGraph(5))\mathrm{IsCompleteGraph}(\mathrm{CompleteGraph}(5))OutTrue\mathrm{True}
live ↗
InIsCompleteGraph(Graph([1,2,3],[UndirectedEdge(1,2),UndirectedEdge(2,3)]))\mathrm{IsCompleteGraph}(\mathrm{Graph}(\bigl\lbrack1, 2, 3\bigr\rbrack, \bigl\lbrack\mathrm{UndirectedEdge}(1, 2), \mathrm{UndirectedEdge}(2, 3)\bigr\rbrack))OutFalse\mathrm{False}
live ↗
InIsCompleteGraph(Graph([1,2],[DirectedEdge(1,2),DirectedEdge(2,1)]))\mathrm{IsCompleteGraph}(\mathrm{Graph}(\bigl\lbrack1, 2\bigr\rbrack, \bigl\lbrack\mathrm{DirectedEdge}(1, 2), \mathrm{DirectedEdge}(2, 1)\bigr\rbrack))OutTrue\mathrm{True}
About
Examples3
Checked againstWolfram Language 3 agreeSageMath 3 agree
CrosswalkWolfram Language

Implementation

mappedsagepackages/oracle/src/mappings.ts

See also: CompleteGraph, IsSimpleGraph