Optimal RIS Partitioning and Power Control for Bidirectional NOMA Networks