commands → subgraph

subgraph(A,L)

The subgraph command takes a (square) adjacency matrix A whose entries are edge weights and a list of indices L, and returns the subgraph induced by L.

Examples

A = [[a,b,c],[d,e,f],[g,h,i]];
subgraph(A,[0,1]);
	[[a, b], [d, e]]