System

RelationGraph

RelationGraph[f,{v1,v2,}]

gives the graph with vertices vi and edges from vi to vj whenever f[vi,vj] is True.

RelationGraph[f,{v1,v2,},{w1,w2,}]

gives the graph with vertices vi,wj and edges from vi to wj whenever f[vi,wj] is True.

Details and Options

  • RelationalGraph takes the same options as Graph.
  • The option DirectedEdges can be used to control whether an undirected or directed graph is constructed.
  • The following settings for DirectedEdges can be used in RelationalGraph:
  • Automaticundirected graph if crit[vi,vj]==crit[vj,vi]
    Trueconstruct a directed graph
    Falseconstruct an undirected graph

Examples

open allclose all

Basic Examples  (2)

Construct a bipartite graph:

In[1]:=
Click for copyable input
Out[1]=

A coprime graph:

In[1]:=
Click for copyable input
Out[1]=

Scope  (4)

Options  (82)

Applications  (12)

Properties & Relations  (4)

See Also

Graph  NearestNeighborGraph

Introduced in 2015
(10.2)