• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 14:19
CEST 20:19
KST 03:19
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL20] Ro8 Preview Pt2: Holding On9Maestros of the Game: Live Finals Preview (RO4)5TL.net Map Contest #21 - Finalists4Team TLMC #5: Vote to Decide Ladder Maps!0[ASL20] Ro8 Preview Pt1: Mile High15
Community News
PartinG joins SteamerZone, returns to SC2 competition215.0.15 Balance Patch Notes (Live version)96$2,500 WardiTV TL Map Contest Tournament 151Stellar Fest: StarCraft II returns to Canada11Weekly Cups (Sept 22-28): MaxPax double, Zerg wins, PTR12
StarCraft 2
General
5.0.15 Balance Patch Notes (Live version) PartinG joins SteamerZone, returns to SC2 competition ZvT - Army Composition - Slow Lings + Fast Banes Stellar Fest: StarCraft II returns to Canada Had to smile :)
Tourneys
Stellar Fest $2,500 WardiTV TL Map Contest Tournament 15 Sparkling Tuna Cup - Weekly Open Tournament LANified! 37: Groundswell, BYOC LAN, Nov 28-30 2025 Maestros of The Game—$20k event w/ live finals in Paris
Strategy
Custom Maps
External Content
Mutation # 493 Quick Killers Mutation # 492 Get Out More Mutation # 491 Night Drive Mutation # 490 Masters of Midnight
Brood War
General
Question regarding recent ASL Bisu vs Larva game RepMastered™: replay sharing and analyzer site [ASL20] Ro8 Preview Pt2: Holding On BarrackS' ASL S20 Ro.8 Review&Power of Friendship BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[ASL20] Ro8 Day 4 [Megathread] Daily Proleagues [ASL20] Ro8 Day 3 Small VOD Thread 2.0
Strategy
TvZ Theorycraft - Improving on State of the Art Current Meta I am doing this better than progamers do. Simple Questions, Simple Answers
Other Games
General Games
Nintendo Switch Thread ZeroSpace Megathread Stormgate/Frost Giant Megathread Dawn of War IV Path of Exile
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI Russo-Ukrainian War Thread Canadian Politics Mega-thread
Fan Clubs
The herO Fan Club! The Happy Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece
Sports
Formula 1 Discussion 2024 - 2026 Football Thread MLB/Baseball 2023 NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
Recent Gifted Posts The Automated Ban List BarCraft in Tokyo Japan for ASL Season5 Final
Blogs
[AI] From Comfort Women to …
Peanutsc
Mental Health In Esports: Wo…
TrAiDoS
Try to reverse getting fired …
Garnet
[ASL20] Players bad at pi…
pullarius1
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1492 users

SC2 beta key contest

Blogs > forti
Post a Reply
forti
Profile Blog Joined April 2010
Singapore9 Posts
Last Edited: 2010-05-04 16:13:12
May 04 2010 15:42 GMT
#1
CONTEST OVER
vesperia won it!

Hello everyone, I got my beta key off one of these contests on TL and recently got my friend invites. I figured I should give it back to TL

The contest will be similar to the one I had to solve (mathematical) and you can either PM me or post in this thread the solution. First person (by time) to give me an acceptable solution will receive the key!

The question is:

Show that determining whether a directed graph G with vertice set V and edge set E contains a universal sink - a vertex with in-degree |V| -1 and out-degree 0 - can be determined in time O(V ), given an adjacency matrix for G.

You will require some basic graph theory and algorithm knowledge to solve this question

edit: Your answer just needs to describe a method/algorithm to obtain the answer and explain why it works, no actual code needed


Here are some useful links

+ Show Spoiler +

http://en.wikipedia.org/wiki/Adjacency_matrix
http://en.wikipedia.org/wiki/Graph_(mathematics)
http://en.wikipedia.org/wiki/Directed_graph#Indegree_and_outdegree
http://en.wikipedia.org/wiki/Asymptotic_upper_bound


Terranlisk
Profile Blog Joined February 2007
Singapore1404 Posts
May 04 2010 15:48 GMT
#2
damnit maths
aka myheronoob
Scorch
Profile Blog Joined March 2008
Austria3371 Posts
May 04 2010 15:51 GMT
#3
Do you mean O(E) or really O(V)?
forti
Profile Blog Joined April 2010
Singapore9 Posts
May 04 2010 15:54 GMT
#4
O(V), O(E) is too easy ^^
Vesperia
Profile Joined April 2010
Canada30 Posts
May 04 2010 16:01 GMT
#5
Is this it?

Let Vij be an adjacency matrix (containing integers 0 and 1)
int hold = 0; // first vertex with vertices number 0..n-1
for (int i = 1; i < n; i++) {
if (V[hold][i] == 1) // hold not a sink
hold = i; //make vertex i the new candidate
//else vertex i does not have in-degree |V| -1 and hold still a sink candidate
i++;
}
// check to see if candidate is a universal sink – it is the only possibility
boolean flag = true;
for (int j = 0; j < n; j++) {
if (j != hold && (V[j][hold] == 0 || V[hold][j] == 1) {
flag == false;
break;
}
}
if (flag)
System.out.println(“Vertex “, hold, “ is universal sink”);
else
System.out.println(“Graph contains no universal sink.”);
//both for-loops execute in O(|V|)
bITt.mAN
Profile Blog Joined March 2009
Switzerland3693 Posts
May 04 2010 16:06 GMT
#6
Damm, why couldn't it be something simpler
BW4LYF . . . . . . PM me, I LOVE PMs. . . . . . Long live "NaDa's Body" . . . . . . Fantasy | Bisu/Best | Jaedong . . . . .
forti
Profile Blog Joined April 2010
Singapore9 Posts
May 04 2010 16:12 GMT
#7
On May 05 2010 01:01 Vesperia wrote:
Is this it?

Let Vij be an adjacency matrix (containing integers 0 and 1)
int hold = 0; // first vertex with vertices number 0..n-1
for (int i = 1; i < n; i++) {
if (V[hold][i] == 1) // hold not a sink
hold = i; //make vertex i the new candidate
//else vertex i does not have in-degree |V| -1 and hold still a sink candidate
i++;
}
// check to see if candidate is a universal sink – it is the only possibility
boolean flag = true;
for (int j = 0; j < n; j++) {
if (j != hold && (V[j][hold] == 0 || V[hold][j] == 1) {
flag == false;
break;
}
}
if (flag)
System.out.println(“Vertex “, hold, “ is universal sink”);
else
System.out.println(“Graph contains no universal sink.”);
//both for-loops execute in O(|V|)


yup that's the solution i had in mind ^^ i'll PM you the key
Vesperia
Profile Joined April 2010
Canada30 Posts
May 04 2010 16:15 GMT
#8
YESSSSS! I finally got one!

Thanks so much forti!!!
forti
Profile Blog Joined April 2010
Singapore9 Posts
May 04 2010 16:33 GMT
#9
btw

for (int i = 1; i < n; i++) {
if (V[hold][i] == 1) // hold not a sink
hold = i; //make vertex i the new candidate
//else vertex i does not have in-degree |V| -1 and hold still a sink candidate
i++;
}

the 2nd i++ is wrong but the general method is correct ^^
yh8c4
Profile Blog Joined July 2009
108 Posts
May 04 2010 18:27 GMT
#10
nice to see that the key i gave to you spawned to another user
Please log in or register to reply.
Live Events Refresh
Next event in 41m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Hui .208
BRAT_OK 74
IndyStarCraft 54
Railgan 50
Nathanias 4
StarCraft: Brood War
Britney 21767
Barracks 307
firebathero 153
PianO 131
Dewaltoss 77
sSak 53
Aegong 25
Dota 2
Gorgc6761
Cr1tdota1784
PGG 96
capcasts21
BeoMulf5
Counter-Strike
fl0m3365
olofmeister2629
Super Smash Bros
Mew2King45
Heroes of the Storm
Liquid`Hasu508
Khaldor438
Other Games
FrodaN4773
singsing2405
Grubby831
Mlord666
KnowMe581
B2W.Neo574
ToD205
Sick151
XcaliburYe127
mouzStarbuck125
UpATreeSC60
rGuardiaN34
Trikslyr26
JuggernautJason14
Organizations
Other Games
EGCTV1670
gamesdonequick808
StarCraft 2
angryscii 39
Other Games
BasetradeTV29
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• Hupsaiya 21
• sooper7s
• AfreecaTV YouTube
• Migwel
• LaughNgamezSOOP
• intothetv
• IndyKCrew
• Kozan
StarCraft: Brood War
• FirePhoenix6
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 4579
League of Legends
• Nemesis4137
• Jankos2476
Other Games
• imaqtpie981
• Shiphtur360
Upcoming Events
BSL Team Wars
41m
Team Bonyth vs Team Dewalt
Dewalt vs kogeT
JDConan vs Tarson
RaNgeD vs DragOn
StRyKeR vs Bonyth
Aeternum vs Hejek
IPSL
41m
DragOn vs Fear
Radley vs eOnzErG
Replay Cast
15h 41m
Map Test Tournament
1d 16h
PiGosaur Monday
2 days
Map Test Tournament
2 days
Tenacious Turtle Tussle
3 days
The PondCast
3 days
Map Test Tournament
3 days
Map Test Tournament
4 days
[ Show More ]
OSC
4 days
Korean StarCraft League
5 days
CranKy Ducklings
5 days
Map Test Tournament
5 days
OSC
5 days
[BSL 2025] Weekly
5 days
Safe House 2
5 days
Sparkling Tuna Cup
6 days
Map Test Tournament
6 days
OSC
6 days
Liquipedia Results

Completed

KCM Race Survival 2025 Season 3
Maestros of the Game
HCC Europe

Ongoing

BSL 20 Team Wars
BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
Acropolis #4 - TS2
C-Race Season 1
IPSL Winter 2025-26
EC S1
ESL Pro League S22
Frag Blocktober 2025
Urban Riga Open #1
FERJEE Rush 2025
Birch Cup 2025
DraculaN #2
LanDaLan #3
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
WardiTV TLMC #15
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.