Should i work with tree representation as an array of nodes and an array of edges
In the unforgettable words of Donald Knuth

Premature optimization is the root of all evil.

Your best option is as follows.  Do what is simplest for you, while maintaining a good abstraction with good encapsulation.  A good abstraction (a well-defined and thought out API) will make it easy for you to change and improve the underlying implementation in the future while not having to change the rest of the application.
When (or really if) you discover that the application is too slow, then you start changing the underlying implementation, but only after a proper complexity analysis.
It is very difficult (if not impossible) to say in advance what will be the bottleneck of the application, so it's best to leave this decision until you actually know.