# Is it possible to query a Knowledge Graph using only Matrix operations?

I am interested in formulating a knowledge graph query in a matrix multiplication/dot product/inner product.

I have found by chance the paper Variational Reasoning for Question Answering with Knowledge Graph which uses a inner product in the last operation (look the picture).

The problem is that the paper is not thoroughly explained the process of inference. It's written "we use beam search" but is not explained. Read:

During inference, we are only given the question q, and ideally we want to find the answer by computing $$\arg \max \log (P_{θ_1}(y|q)P_{θ_2} (a|y, q))$$. However, this computation is quadratic in the number of entities and thus too expensive. Alternatively, we can approximate it via beam search.

I think that there is an implicit inner product structure inside the beam search algorithm but I haven't found any explanation through google.

Can someone explain better the above mentioned inner product?