'yes' it is genetic, though lifestyle factors contribute to improving or worsening symptoms.
The most important thing is a solid diagnosis before treating. Dietary changes with or without medicine can be helpful sometimes. There is a minor surgical procedure called ovarian diathermy
that seems very helpful for selected patients, although not all experts agree about the pros and cons.