I (try to) do research in Computer Science/Deep Learning. I recently did some work developing a novel idea and am writing a paper on it. I have only written one paper before, and I'm currently being paralysed by the related works section.
It seems impossible for me to have a thorough understanding of everything that is related. When I started the work, I was working from the understanding I had at the time. The vast majority of the influence on my work was only from ~4 other papers, and what I took from them as background in the area.
In doing the work, I have come to understand other work and the context much better (I find that working on a problem, and attempting to explain my work, demystifies a lot of statements in other people's papers). Now, reading other papers on other related work is more plausible for me. I'm realising that I've made some assumptions based on those core papers, and want to find citations for them.
This appears backwards to how it's supposed to work; the papers that I would cite in this manner I hadn't read or understood before I started working. So, my main question is: is it illegitimate to cite several papers you hadn't read before completing the majority of the experiments?
Follow up questions are: Is it normal to only have a few main influences, and many lesser influences? (Computer-science-specific) How much of a paper's theory/background is worked out after making it work? Is it my fault if I haven't come across some important related idea, or is it generally accepted that you might miss something?