Optimization of amorphous semiconductors and low-/high-k dielectrics through percolation and topological constraint theory