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.
A = [[a,b,c],[d,e,f],[g,h,i]]; subgraph(A,[0,1]); [[a, b], [d, e]]