  This paper explores Physical-Layer Security (PLS) in Flexible Duplex (FlexD)
networks, considering scenarios involving eavesdroppers. Our investigation
revolves around the intricacies of the sum secrecy rate maximization problem,
particularly when faced with coordinated and distributed eavesdroppers
employing a Minimum Mean Square Error (MMSE) receiver. Our contributions
include an iterative classical optimization solution and an unsupervised
learning strategy based on Graph Neural Networks (GNNs). To the best of our
knowledge, this work marks the initial exploration of GNNs for PLS
applications. Additionally, we extend the GNN approach to address the absence
of eavesdroppers' channel knowledge. Extensive numerical simulations highlight
FlexD's superiority over Half-Duplex (HD) communications and the GNN approach's
superiority over the classical method in both performance and time complexity.
