2 answers
Tableau doesn't have the built-in algorithms needed to build a network diagram, so you have to do a bit of data prep outside of Tableau. I'd recommend the following. One uses Gephi and the other uses D3.
https://thedatasurfers.com/2019/08/27/how-to-use-gephi-to-create-network-visualizations-for-tableau/
https://ladataviz.com/2019/12/15/build-a-network-graph-in-tableau-in-three-steps/
Give these a try and let us know if you get stuck.