1234567891011121314151617181920212223242526272829303132333435 |
PackageMainImport("FMT""Github.com/looplab/tarjan")funcMain () {graph: = Make(Map[Interface{}][]Interface{}) graph["Chelsea"] = []Interface{}{"Manchester City","Tottenham","Middlesbrough","Everton","Southampton","Manchester United","Leicester City","Hull City","Burnley","Waterford","West Ham"}graph["Arsenal"] = []Interface{}{"West Ham","Bournemouth","Sunderland","Swansea","Burnley","Chelsea","Hull City","Southampton","Waterford"}graph["Liverpool"] = []Interface{}{"Sunderland","Waterford","Crystal Palace","West Bromwich Albion","Swansea","Hull City","Chelsea","Leicester City","Arsenal"}graph["Manchester City"] = []Interface{}{"Crystal Palace","Burnley","West Bromwich Albion","Swansea","Bournemouth","Manchester United","West Ham","Stoke City","Sunderland"}graph["Tottenham"] = []Interface{}{"Swansea","West Ham","Manchester City","Middlesbrough","Sunderland","Stoke City","Crystal Palace"}graph["Manchester United"] = []Interface{}{"Swansea","Leicester City","Hull City","Southampton","Bournemouth"}graph["West Bromwich Albion"] = []Interface{}{"Waterford","Burnley","Leicester City","West Ham","Bournemouth","Crystal Palace"}graph["Everton"] = []Interface{}{"West Ham","Stoke City","West Bromwich Albion"}graph["Stoke City"] = []Interface{}{"Burnley","Waterford","Swansea","Hull City","Sunderland"}graph["Bournemouth"] = []Interface{}{"Liverpool","Stoke City","Hull City","Everton","West Bromwich Albion"}graph["Waterford"] = []Interface{}{"Leicester City","Hull City","Middlesbrough","Manchester United","West Ham"}graph["Southampton"] = []Interface{}{"Everton","Burnley","West Ham","Swansea"}graph["Middlesbrough"] = []Interface{}{"Hull City","Bournemouth","Sunderland"}graph["Crystal Palace"] = []Interface{}{"Southampton","Sunderland","Stoke City","Middlesbrough"}graph["Everton"] = []Interface{}{"West Ham","Middlesbrough","Sunderland"}graph["Burnley"] = []Interface{}{"Crystal Palace","Everton","Waterford","Liverpool"}graph["Leicester City"] = []Interface{}{"Crystal Palace","Burnley","Swansea"}graph["West Ham"] = []Interface{}{"Sunderland","Crystal Palace","Bournemouth"}graph["Sunderland"] = []Interface{}{"Leicester City","Hull City","Bournemouth"}graph["Hull City"] = []Interface{}{"Southampton","Swansea","Leicester City"}graph["Swansea"] = []Interface{}{"Crystal Palace","Burnley"}output: = Tarjan. Connections (graph) fmt. Printf ("%d,%v\n",Len(Output[0]), Output)} |