  Graphs are a ubiquitous data structure to model processes and relations in a
wide range of domains. Examples include control-flow graphs in programs and
semantic scene graphs in images. Identifying subgraph patterns in graphs is an
important approach to understanding their structural properties. We propose a
visual analytics system GraphQ to support human-in-the-loop, example-based,
subgraph pattern search in a database containing many individual graphs. To
support fast, interactive queries, we use graph neural networks (GNNs) to
encode a graph as fixed-length latent vector representation, and perform
subgraph matching in the latent space. Due to the complexity of the problem, it
is still difficult to obtain accurate one-to-one node correspondences in the
matching results that are crucial for visualization and interpretation. We,
therefore, propose a novel GNN for node-alignment called NeuroAlign, to
facilitate easy validation and interpretation of the query results. GraphQ
provides a visual query interface with a query editor and a multi-scale
visualization of the results, as well as a user feedback mechanism for refining
the results with additional constraints. We demonstrate GraphQ through two
example usage scenarios: analyzing reusable subroutines in program workflows
and semantic scene graph search in images. Quantitative experiments show that
NeuroAlign achieves 19-29% improvement in node-alignment accuracy compared to
baseline GNN and provides up to 100x speedup compared to combinatorial
algorithms. Our qualitative study with domain experts confirms the
effectiveness for both usage scenarios.
