In Munkres' book "Topology", (finite) linear graph is defined in P.308, Example 6, as the following picture shows.

The implication from compact to closed for edges demands that these edges be regarded as compact subspaces of $\displaystyle G$, which, however, is not mentioned in the definition of (finite) linear graph in this paragraph. I searched the Internet but did not find its precise definition, so I hope I can find help here: what is the precise definition of (finite) linear graph? Is it indispensable that each edge, or arc, is a subspace of $\displaystyle G$?
Another question: if we union a number of spaces $\displaystyle X_i$ together, can the union $\displaystyle X=\cup X_i$ be topologized such that each $\displaystyle X_i$ is a subspace of the union space $\displaystyle X$?