>>535181773
First you have to explain what you mean by optimal : for resource? player time? Aesthetics? All of the above?
It's really hard to research because factorio players don't tend to play the same way with the same settings and the same base layout.
So you would need to test a whole array of starting conditions accounting for research level, biter settings, etc.
It's easy to overdesign your wall and end-up with lower resource efficiency. If you go the under-design route, where biters sometimes destroying a certain percent of your wall is acceptable, then that brings another layer of complexity.
Then there's biter pathing that will change how strong your walls need to be in corners and around choke points.
And then you end up thinking about pollution management as part of your wall design, with funny ideas like "do I even need a wall here?" and you place one arty turret surrounded with a few laser turrets, where their coverage overlap.