{"id":17224221,"url":"https://github.com/ekstroem/thechallenge","last_synced_at":"2026-01-29T21:01:36.509Z","repository":{"id":90094151,"uuid":"37885742","full_name":"ekstroem/TheChallenge","owner":"ekstroem","description":null,"archived":false,"fork":false,"pushed_at":"2015-07-22T11:29:51.000Z","size":223,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-07T10:47:36.577Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ekstroem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-22T23:22:13.000Z","updated_at":"2015-06-22T23:22:13.000Z","dependencies_parsed_at":"2023-02-27T23:10:35.521Z","dependency_job_id":null,"html_url":"https://github.com/ekstroem/TheChallenge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ekstroem/TheChallenge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekstroem%2FTheChallenge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekstroem%2FTheChallenge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekstroem%2FTheChallenge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekstroem%2FTheChallenge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ekstroem","download_url":"https://codeload.github.com/ekstroem/TheChallenge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekstroem%2FTheChallenge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28884695,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T19:55:09.949Z","status":"ssl_error","status_checked_at":"2026-01-29T19:55:08.490Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T04:10:33.492Z","updated_at":"2026-01-29T21:01:36.478Z","avatar_url":"https://github.com/ekstroem.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Challenge\n\n## Mål\nMan skal - kun ved hjælp af transport med S-tog i hovedstadsområdet - se, hvor hurtig man\nkan transportere sig rundt langs S-togsnettet. Kravene er, at man \n\n1. stopper på alle stationer (men behøver ikke at forlade toget) mindst\nen gang.\n2. kan starte på en vilkårlig station og kan ende på en vilkårlig station\n3. Høvelte skal _ikke_ tages med på listen af stationer, der skal besøges.\n\nAltså et traveling salesmanproblem, hvor man\n * ikke har en begrænsning på kun at besøge hver by en gang.\n * skal tage højde for ventetider mellem togene\n\n\nEksempel på data kan findes [her](data/tog.csv), hvilket er\noplysninger fra de hvide køretider hentet 1. juli 2015. Bemærk, at\nlinje Bx ikke er med i de pågældende data, men den kan tilføjes.\n\n\n```R\n# Read data\nindata \u003c- read.csv2(\"data/tog.csv\", header=FALSE, col.names=c(\"station\", \"tid\"), as.is=TRUE)\n\n# Simple data fixing\nconvertData \u003c- function(o) {\nno \u003c- NROW(o)\ndifft \u003c- diff(o$tid)\n    difft[!is.na(difft) \u0026 difft\u003c0] \u003c- difft[!is.na(difft) \u0026 difft\u003c0] + 60\n\t    res \u003c- data.frame(from=o$station[-no], to=o$station[-1], tid=difft, weight=difft, stringsAsFactors=FALSE)\n\t\tres[!is.na(res$tid),]\n}\n\ntog \u003c- convertData(indata)\n\n\nlibrary(igraph)\n\n# This object contains a graph data frame with the columns\n# from, to, dist and weight. Dist and weight are identical\n# And refer to the distance (in minutes) between neighboring stations\nnetwork \u003c- graph.data.frame(tog, directed=FALSE)\n\n# This matrix contains an 84x84 matrix of neighboring stations\nneighbormatrix \u003c- as.matrix(get.adjacency(network))\n\n# And this matrix contains minimum distance (in minutes) between\n# all pairs of stations\ndistancematrix \u003c- shortest.paths(network)\n\n```\n\n![Network graph](https://cdn.rawgit.com/ekstroem/TheChallenge/master/pics/graph.svg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekstroem%2Fthechallenge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fekstroem%2Fthechallenge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekstroem%2Fthechallenge/lists"}