Skip to content

Commit

Permalink
Adding Approximation Algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
Crazy-Ginger committed Apr 17, 2018
1 parent 0f0c948 commit 05b813c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Tester.sln
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.16
VisualStudioVersion = 15.0.26730.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Tester", "Tester\Tester.vbproj", "{DE29B046-2156-4095-99B3-5CDC9B45B141}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8FCAB349-F574-40FD-BCF2-C682457357EA}"
ProjectSection(SolutionItems) = preProject
Tester\Cities.txt = Tester\Cities.txt
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
1 change: 1 addition & 0 deletions Tester/Cities.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"London","Birmingham","Leeds","Glasgow","Sheffield","Bradford","Liverpool","Edinburgh","Manchester","Bristol","Kirklees","Fife","Wirral","NorthLanarkshire","Wakefield","Cardiff","Dudley","Wigan","EastRiding","SouthLanarkshire","Coventry","Belfast","Leicester","Sunderland","Sandwell","Doncaster","Stockport","Sefton","Nottingham","Newcastle-upon-Tyne","Kingston-upon-Hull","Bolton","Walsall","Plymouth","Rotherham","Stoke-on-Trent","Wolverhampton","RhonddaCynonTaff","SouthGloucestershire","Derby","Swansea","Salford","Aberdeenshire","Barnsley","Tameside","Oldham","Trafford","Aberdeen","Southampton","Highland","Rochdale","Solihull","Gateshead","MiltonKeynes","NorthTyneside","Calderdale","Northampton","Portsmouth","Warrington","NorthSomerset","Bury","Luton","StHelens","Stockton-on-Tees","Renfrewshire","York","Thamesdown","Southend-on-Sea","NewForest","Caerphilly","Carmarthenshire","Bath&NorthEastSomerset","Wycombe","Basildon","Bournemouth","Peterborough","NorthEastLincolnshire","Chelmsford","Brighton","SouthTyneside","Charnwood","AylesburyVale","Colchester","Knowsley","NorthLincolnshire","Huntingdonshire","Macclesfield","Blackpool","WestLothian","SouthSomerset","Dundee","Basingstoke&Deane","Harrogate","Dumfries&Galloway","Middlesbrough","Flintshire","Rochester-upon-Medway","TheWrekin","Newbury","Falkirk","Reading","Wokingham","Windsor&Maidenhead","Maidstone","Redcar&Cleveland","NorthAyrshire","Blackburn","NeathPortTalbot","Poole","Wealden","Arun","Bedford","Oxford","Lancaster","Newport","Canterbury","Preston","Dacorum","Cherwell","Perth&Kinross","Thurrock","Tendring","KingsLynn&WestNorfolk","StAlbans","Bridgend","SouthCambridgeshire","Braintree","Norwich","Thanet","IsleofWight","MidSussex","SouthOxfordshire","Guildford","Elmbridge","Stafford","Powys","EastHertfordshire","Torbay","WrexhamMaelor","EastDevon","EastLindsey","Halton","Warwick","EastAyrshire","Newcastle-under-Lyme","NorthWiltshire","SouthKesteven","EppingForest","ValeofGlamorgan","Reigate&Banstead","Chester","MidBedfordshire","SuffolkCoastal","Horsham","Nuneaton&Bedworth","Gwynedd","Swale","Havant&Waterloo","Teignbridge","Cambridge","ValeRoyal","AmberValley","NorthHertfordshire","SouthAyrshire","Waverley","Broadland","Crewe&Nantwich","Breckland","Ipswich","Pembrokeshire","ValeofWhiteHorse","Salisbury","Gedling","Eastleigh","Broxtowe","Stratford-on-Avon","SouthBedfordshire","Angus","EastHampshire","EastDunbartonshire","Conway","Sevenoaks","Slough","BracknellForest","WestLancashire","WestWiltshire","Ashfield","Lisburn","Scarborough","Stroud","Wychavon","Waveney","Exeter","Dover","TestValley","Gloucester","Erewash","Cheltenham","Bassetlaw"
12 changes: 9 additions & 3 deletions Tester/Module1.vb
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,20 @@ Module Module1

Public Function Approximation(ByVal nodes As List(Of String), ByVal last As Boolean)
Dim length As Integer = nodes.Count - 1
Dim using_URL As New StringBuilder
If last = True Then
length -= 1
End If
Dim chosen As String = ""
Dim next_nodes(length) As String
For i As Integer = 0 To nodes.Count - 1
Dim next_nodes As List(Of String) = nodes
Dim final_route As New List(Of String)
final_route.Add(next_nodes.Item(0))
next_nodes.Remove(0)
While next_nodes.Count > 0
For i As Integer = 0 To next_nodes.Count - 1

Next
Next
End While
Return Nothing
End Function

Expand Down
19 changes: 19 additions & 0 deletions Tester/Test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<title>Here</title>
</head>
<body>
<script>
var countries = ["Abbotsbury", "Abingdon", "Accrington", "Acton", "Albrighton", "Alcester", "Aldeburgh", "Alford", "Alnmouth", "Alnwick", "Alston", "Alveston", "Aylsham", "Ambleside", "Amersham", "Andover", "Arundel", "Ascot", "Ashbourne", "Ashburton", "Ashby-de-la-Zouch", "Ashford", "Ashorne", "Askrigg", "Atherstone", "Axbridge", "Axminster", "Aylesbury", "Badminton", "Bagshot", "Baker Street", "Bakewell", "Baldersdale", "Baldock", "Bamburgh", "Bampton", "Banbury", "Barbican", "Bardon Mill", "Barnard Castle", "Barnet", "Barnsley", "Barnstaple", "Barrow-in-Furness", "Basildon", "Basingstoke", "Bath", "Batley", "Battle", "Beaconsfield", "Beccles", "Bedale", "Bedford", "Beer", "Belford", "Belgravia", "Belton", "Berkhamsted", "Berrow", "Berwick upon Tweed", "Bewdley", "Bexley", "Bicester", "Bicknoller", "Bideford", "Bilbrook", "Bingley", "Birmingham", "Bishop Auckland", "Bishops Stortford", "Blackburn", "Blackpool", "Bloomsbury", "Bodmin", "Bognor Regis", "Bolton", "Borrowdale", "Boscastle", "Boston", "Bournemouth", "Bovey Tracey", "Bowness", "Bracknell", "Bradford", "Braintree", "Bridgnorth", "Bridgwater", "Bridlington", "Bridport", "Brighton", "Bristol", "Brixham", "Broadstairs", "Broadway", "Bromborough", "Bromsgrove", "Buckland", "Bude", "Budleigh Salterton", "Bures", "Burford", "Burnham Market", "Burnley", "Burton-on-Trent", "Bury", "Bury St Edmunds", "Buxton", "Camberley", "Cambridge", "Camden", "Canning Town", "Canterbury", "Carlisle", "Castel", "Castle Ashby", "Castle Combe", "Castle Donington", "Catford", "Cattistock", "Chaddesley Corbett", "Charlbury", "Charlwood", "Chatham", "Cheadle (Lancashire)", "Cheadle (Satffordshire)", "Cheddar", "Chelmsford", "Chelsea", "Cheltenham", "Cheshunt", "Chester", "Chesterfield", "Chichester", "Chiddingly", "Chinnor", "Chippenham", "Chipping Campden", "Chipping Norton", "Chiswick", "Chorley", "Christchurch", "Church Stretton", "Cirencester", "City of London", "Clacton-on-Sea", "Clapham(London)", "Clerkenwell", "Clifton-Without", "Clitheroe", "Clovelly", "Clun", "Coalville", "Cockermouth", "Colchester", "Coleshill", "Commondale", "Coniston", "Corby", "Corfe Castle", "Cornhill on Tweed", "Coulsdon", "Coventry", "Crackington Haven", "Crawley", "Crewe", "Crewkerne", "Cricklewood", "Cromer", "Crowthorne", "Croydon", "Cuckfield", "Danby", "Darlington", "Dartford", "Dartmoor", "Dartmouth", "Daventry", "Dawlish", "Deal", "Deddington", "Denon", "Derby", "Dereham", "Devizes", "Devon", "Dewsbury", "Didcot", "Diss", "Ditchling", "Docklands", "Doncaster", "Dorchester-on-Thames", "Dorchester", "Dorking", "Dorsington", "Douglas", "Dover", "Downham Market", "Droitwich", "Droitwich Spa", "Dudley", "Dukinfield", "Dulverton", "Dumbleton", "Dunmow", "Dunstable", "Dunster", "Durham", "Duxford", "Dymchurch", "Ealing", "Earls Court", "East Cottingwith", "East Grinstead", "East Horsley", "East Molesey", "Eastbourne", "Eastleigh", "Eccles", "Edenbridge", "Egham", "Ellesmere Port", "Ellington", "Enfield", "Epping", "Eskdale", "Euston", "Evesham", "Ewloe", "Exeter", "Exmoor National Park", "Exmouth", "Fakenham", "Falmouth", "Faringdon", "Farnborough", "Farnham", "Faversham", "Fawkham", "Felixstowe", "Ferndown", "Finchley", "Fleet", "Folkestone", "Fordingbridge", "Forest", "Forest Row", "Fowey", "Framlingham", "Freshwater", "Fulham", "Gateshead", "Gatwick (Airport)", "Gerrards Cross", "Gillingham", "Glaisdale", "Glastonbury", "Glossop", "Gloucester", "Goathland", "Golders Green", "Gomersal", "Goole", "Gorleston", "Gracechurch", "Grantham", "Grasmere", "Gravesend", "Grays", "Great Dunmow", "Great Torrington", "Great Yarmouth", "Greenwich", "Grimsby", "Guernsey", "Guildford", "Guiting Power", "Hadrians Wall", "Hailsham", "Hale", "Halifax", "Haltwhistle", "Hammersmith", "Hampstead", "Hampton Court", "Hanwell", "Harleston", "Harlow", "Harmondsworth", "Harpenden", "Harrogate", "Harrow", "Hartington", "Hartlepool", "Harvington", "Harwich", "Haslemere", "Hassocks", "Hastings", "Hatfield", "Hathersage", "Havant", "Haverhill", "Hawkshead", "Haydock", "Hayes", "Hayle", "Hayling Island", "Haywards Heath", "Heathfield", "Heathrow", "Heathrow (Airport)", "Helmsley", "Helston", "Helton", "Hemel Hempstead", "Hemingford Grey", "Henley on Thames", "Hereford", "Hertford", "Heversham", "Hexham", "Heywood (Lancashire)", "Heywood (Wiltshire)", "High Wycombe", "Highbridge", "Hillingdon", "Hinckley", "Hilton", "Hitchin", "Holborn", "Holsworthy", "Honiton", "Hook", "Hope Valley", "Horley", "Horncastle", "Horrabridge", "Horsham", "Horsington", "Hounslow", "Hove", "Huddersfield", "Hull", "Hungerford", "Hunstanton", "Huntingdon", "Hutton Le Hole", "Hyde", "Hyde Park", "Hythe", "Ifield", "Ilfracombe", "Immingham", "Ingleton", "Ipswich", "Isle of Man", "Isle of Sheppey", "Isle of Wight", "Islington", "Jersey", "Jesmond", "Keighley", "Kempsey", "Kendal", "Kenilworth", "Kensington", "Kent", "Keswick", "Kettering", "Kew", "Kidderminster", "Kings Cross", "Kings Langley", "Kings Lynn", "Kingsbridge", "Kingston upon Hull", "Kingston upon Thames", "Kirkby Lonsdale", "Kirkby Stephen", "Knightsbridge", "Knipton", "Knowsley", "Knutsford", "Lacock", "Lake District", "Lambeth", "Lamorna", "Lancaster Gate", "Lancaster", "Lancing", "Larkfield", "Launceston", "Lavenham", "Leamington Spa", "Leatherhead", "Ledbury", "Leek", "Leeds", "Leicester", "Leicester Square", "Leigh (Kent)", "Leigh (surrey)", "Leighton Buzzard", "Leiston-cum-Sizewell", "Letchworth", "Lewes", "Leyburn", "Lichfield", "Lifton", "Lincoln", "Lightwater", "Lincoln", "Liphook", "Liskeard", "Little Venice", "Liverpool", "Lolworth", "London", "Looe", "Lostwithiel", "Loughborough", "Louth", "Lowestoft", "Ludlow", "Lulworth Cove", "Luton", "Lyme Regis", "Lymington", "Lymm", "Lympsham", "Lyndhurst", "Lynton", "Macclesfield", "Maidenhead", "Maidstone", "Malmesbury", "Malton", "Malvern", "Manchester", "Manningtree", "Mansfield", "Marazion", "Marble Arch |Margate", "Market Drayton", "Market Harborough", "Markfield", "Marlborough", "Marlow", "Marlow-on-Thames", "Martlock", "Marylebone", "Matlock", "Mawgan Porth", "Mayfair", "Melbourne", "Melksham", "Melton Mowbray", "Meriden", "Mevagissey", "Middlesbrough", "Midhurst", "Mildenhall", "Milford-on-Sea", "Mill Hill", "Milton Keynes", "Minehead", "Minster Lovell", "Modbury", "Morecambe", "Moreton-in-Marsh", "Morpeth", "Mousehole", "Much Hadham", "Much Wenlock", "Mullion", "Muswell Hill", "Newark", "Newbury", "Newcastle-upon-Tyne", "Newcastle-under-Lyme", "Newick", "Newmarket", "Newnham", "New Forest", "Newquay", "Newton Aycliffe", "Norfolk Broads", "North Acton", "North Ferriby", "North Walsham", "North Yorkshire National Park", "Northallerton", "Northampton", "Northwich", "Norwich", "Notting Hill", "Nottingham", "Nuneaton", "Oakamoor| Ogbourne St George", "Okehampton", "Old Harlow", "Oldham", "Ormskirk", "Oswestry", "Otley", "Otterburn", "Oundle", "Outlane", "Oxford Street", "Oxford", "Paddington", "Padstow", "Paignton", "Peak District", "Penrith", "Penzance", "Perranporth", "Pershore", "Peterborough", "Petworth", "Piccadilly Circus", "Piccadilly", "Pickering", "Piercebridge-on-Tees", "Pimlico", "Plymouth", "Polesworth", "Polperro", "Polruan-by-Fowey", "Polzeath", "Poole", "Porthleven", "Portland", "Portsmouth", "Potters Bar", "Prenton", "Prescot", "Preston", "Putney", "Pyrford", "Ramsey", "Ramsgate", "Reading", "Redditch", "Redhill", "Regents Park", "Retford", "Ringwood(Dorset)", "Ringwood (Hampshire)", "Richmond", "Richmond-upon-Thames", "Ripon", "Robin Hoods Bay", "Rochdale", "Rock", "Romsey", "Ross-on-Wye", "Rotherham", "Rotherhithe", "Royal Docks", "Royston", "Rugby", "Ruislip", "Runcorn", "Rydal Water", "Ryde", "Rye", "Salford", "Salisbury", "Sandbach", "Sandford on Thames", "Sandown", "Sandwich", "Sandy", "Sawtry", "Sawbridgeworth", "Scarborough", "Scotch Corner", "Scunthorpe", "Seahouses", "Seascale", "Seaview", "Selby", "Settle", "Sevenoaks", "Shaldon", "Shanklin", "Shap", "Shardlow", "Sheerness", "Sheffield", "Shepherds Bush", "Shepperton", "Shepton Mallet", "Sherborne", "Sheringham", "Shifnal", "Shipley", "Shipton-under-Wychwood", "Shoreditch", "Shrewsbury", "Sittingbourne", "Skegness", "Skelmersdale", "Skipton", "Sleaford", "Sloane Gardens", "Sloane Square", "Slough", "Soho", "Solihull", "South Benfleet", "South Brent", "South Croydon", "South Kensington", "South Littleton", "South Ruislip", "South Shields", "Southall", "Southam", "Southampton", "Southend-on-Sea", "Southport", "Southsea", "St Albans", "St Aubin", "St Austell", "St Brelades Bay", "St Helier", "St Issey", "St Ives (Cornwall)", "St James Park", "St Johns Wood", "St Johns (Isle of Man)", "St Katharines Marina", "St Lawrence", "St Leonards-on-Sea", "St Martin", "St Mawes", "St Pancras", "St Peter Port", "St Saviour", "Stafford", "Stamford", "Stansted (Airport)", "Stanton Drew", "Steeple Aston", "Stevenage", "Stilton", "Stockbridge", "Stockport", "Stockton on Tees", "Stoke-on-Trent", "Stone", "Stonehouse", "Stourport on Severn", "Stow-on-the-Wold", "Stowmarket", "Stratfield Mortimer", "Stratford-upon-Avon", "Stratford", "Streatham Hill", "Stroud", "Studland", "Sunderland", "Surbiton", "Sutton Coldfield", "Sutton-in-Ashfield", "Swadlincote", "Swaffham", "Swanage", "Swindon", "Tamar Valley (Cornwall)", "Tamar Valley (Devon)", "Tamworth", "Taplow", "Tarporley", "Taunton", "Tavistock", "Telford", "Temple Sowerby", "Tenterden", "Tetbury", "Tettenhall Wood", "Thame", "The Embankment", "Thetford", "Thirsk", "Threlkeld", "Tintagel", "Tiverton", "Thompson", "Tonbridge", "Torquay", "Totland Bay", "Totnes", "Tottenham Court Road", "Tower Bridge", "Trafalgar Square", "Tregony", "Trevone", "Trowbridge", "Truro", "Tunbridge Wells", "Two Bridges", "Tysoe", "Uckfield", "Ullswater", "Up Holland", "Upminster", "Uppingham", "Upton upon Severn", "Uxbridge", "Vauxhall", "Ventnor", "Wadebridge", "Wakefield", "Wallasey", "Wallingford", "Walsall", "Waltham Forest", "Wandsworth", "Wantage", "Ware", "Wareham", "Warkworth", "Warrington", "Warwick", "Wasdale", "Washington", "Watchet", "Waterloo", "Watford", "Wellingborough", "Wells (Norfolk)", "Wells (Somerset)", "Welwyn", "Welwyn Garden City", "Wembley", "Weobley", "West Bromwich", "Westbury on Severn", "West Drayton", "West Ealing", "West End", "West Ham", "Westcliff On Sea", "Westminster", "Weston-Super-Mare", "Wetherby", "Weymouth", "Whitby", "Whitchu"];
console.log(countries.length)
var box =document.getElementById("box")
box.setAttribute("value", countries.length)
</script>
<div>Content goes here.</div>
<p>
Please work?
</p>
<input id="box" type="text" value=""></label>
</body>
</html>

0 comments on commit 05b813c

Please sign in to comment.